yosoh
yosoh

Reputation: 93

Detecting NFC on android devices

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 isNFCSupported()? any ideas?

thanks yosoh.

Upvotes: 9

Views: 4493

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006614

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

Upvotes: 23

Related Questions