Zapnologica
Zapnologica

Reputation: 22556

How to check if a phone has NFC in its hard ware

I am developing an application that makes use of NFC tags,

Is there a way to detect if the device it is running on has NFC ? and if it does not then i can display an alternative like possibly manually entering in the data rather than swiping the phone over the NFC tag?

If the phone has got the nfc feature then i would obviously ask them to turn it on if its currently disabled and then prompt them to swipe the tag.

Upvotes: 0

Views: 938

Answers (1)

Delyan
Delyan

Reputation: 8911

Use the PackageManager :

getPackageManager().hasSystemFeature(PackageManager.FEATURE_NFC)

Upvotes: 4

Related Questions