排除带有 NFC 的非 NXP Android 手机(如 Nexus 4/10) [英] Exclude non-NXP Android phones with NFC (like the Nexus 4/10)

查看:16
本文介绍了排除带有 NFC 的非 NXP Android 手机(如 Nexus 4/10)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经构建了一个应用程序,可以从我们学校使用的学生证中读取某些数据.目前它只读取用户数据,但未来计划是增加对读取剩余信用的支持.

I've built an app that reads out certain data from the student ID cards our school uses. Right now it only reads user data but in the future the plan is to add support to read the remaining credit.

问题是我们使用的卡是 Mifare Classic.Nexus 4 和 Nexus 10(可能还有更多设备)不支持这些卡,因为它们具有 Broadcom NFC 控制器.如果我是对的,那么应用程序不应该在这些设备上崩溃或出现问题,但它什么也不做.

The problem is that the cards we use are Mifare Classic. Nexus 4 and Nexus 10 (and possibly more devices) don't support these cards since they have a Broadcom NFC controller. If I'm right the app shouldn't crash or give issues on those devices, but it just doesn't do anything.

有没有办法在没有 NXP 控制器的情况下排除这些设备?(基本上就像 MifareClassic 类所需的使用功能.)我可以通过 Play 商店排除 Nexus 4 和 10,但仅此而已几乎不是一个好的解决方案 - 更何况其他设备可能会开始使用 Broadcom 控制器,并且必须手动排除它们.

Is there a way to somehow exclude these devices without NXP controller? (Basically like uses-feature required for the MifareClassic class.) I can exclude the Nexus 4 and 10 through the Play Store but that's hardly a good solution - even more because other devices might start using Broadcom controllers and they'd all have to be excluded manually.

谢谢!- 安布鲁斯

推荐答案

您可以按如下方式签入您的应用以获得 MIFARE Classic 支持:

You can check in your app for MIFARE Classic support as follows:

boolean hasMifare(Context ctx) {
 return ctx.getPackageManager().hasSystemFeature("com.nxp.mifare");
}

在安装应用程序之前无法进行检查.但安装后,您可以警告用户您的应用的功能将受到限制,因为缺少 MIFARE Classic 支持.

There is no way to check for this before installing the app. But after installation, you can warn the user that the functionality of your app will be limited, because of the lack of MIFARE Classic support.

这篇关于排除带有 NFC 的非 NXP Android 手机(如 Nexus 4/10)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆