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

查看:267
本文介绍了排除非恩智浦Android手机与NFC(如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经典。关系4和Nexus 10(以及可能更多的设备)并不因为它们具有博通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类。使用特征),我可以排除的Nexus 4和10〜Play商店但这几乎没有一个很好的解决方案 - 甚至更多,因为其他设备可能会开始使用博通的控制器,他们会都必须手动排除

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.

谢谢! - Ambroos

Thanks! - Ambroos

推荐答案

您可以在您的应用程序的MIFARE经典支持检查如下:

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

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

有没有办法安装应用程序之前检查这一点。但在安装后,你可以警告,由于缺乏MIFARE经典支持您的应用程序的功能将受到限制的用户。

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.

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

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