在Android设备上检测NFC [英] Detecting NFC on android devices
问题描述
嗯,我的目的是为了检测是否在Android设备支持NFC,如果没有,我会用一些其他的技术。我已经把我的最低API级别为8,因为我想我的应用程序的功能,即使在这些设备上没有NFC。
Well, my purpose is to detect if the Android device supports NFC and if not I will use some other technology. I have set my minimum API level to 8 as I want my app to function even on these devices without NFC.
有没有像isNFCSupported()的方法?任何想法?
Is there a method like isNFCSupported()? any ideas?
谢谢 yosoh。
推荐答案
第1步:将这个在你的清单:
Step #1: Put this in your manifest:
<uses-feature android:name="android.hardware.nfc" android:required="false" />
第二步:拨打<一href="http://developer.android.com/reference/android/content/pm/PackageManager.html#hasSystemFeature%28java.lang.String%29"><$c$c>hasSystemFeature(PackageManager.FEATURE_NFC)$c$c>在 PackageManager
来看看NFC可在当前设备上
Step #2: Call hasSystemFeature(PackageManager.FEATURE_NFC)
on PackageManager
to see if NFC is available on the current device
这篇关于在Android设备上检测NFC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!