开发者

Detecting NFC on android devices

开发者 https://www.devze.com 2023-03-01 05:16 出处:网络
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 wi

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.

Is there a method like is开发者_运维问答NFCSupported()? any ideas?

thanks yosoh.


Step #1: Put this in your manifest:

<uses-feature android:name="android.hardware.nfc" android:required="false" />

Step #2: Call hasSystemFeature(PackageManager.FEATURE_NFC) on PackageManager to see if NFC is available on the current device

0

精彩评论

暂无评论...
验证码 换一张
取 消