Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detecting NFC on android devices

Tags:

android

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.

Is there a method like isNFCSupported()? any ideas?

thanks yosoh.

like image 574
yosoh Avatar asked Apr 27 '11 13:04

yosoh


People also ask

Where do I find NFC on my Android phone?

You can check for NFC settings on your Samsung Android device by looking in the settings app > connections > tap NFC and contactless payments. If you see an option for NFC there, your device is enabled to make NFC payments.

How do I check NFC on another phone?

Tap the Settings icon. Tap Connected devices. Select the Connection preferences option. Select NFC.

What devices can read NFC?

Every iPhone since the iPhone 6 Version 3 of the app includes NFC triggers for iPhone XR, XS, and XS Max for actions via custom NFC stickers. The iPhone 7 and newer phones can use in-app NFC scanning. Launch Center Pro for iPad has been retired, and the iOS version now supports both iPhone and iPad.


1 Answers

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

like image 89
CommonsWare Avatar answered Oct 18 '22 01:10

CommonsWare