2

I have developed an Application which deals with NFC.

Currently my Application can not be downloaded from play store if user's device doesn't support NFC.

I want it to be downloaded from all devices i.e. it should be compatible with all devices regardless of NFC support.

I have used this line in manifest :

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

Will this solve my issue??

I am new to NFC, so I'm not getting any idea what should I do to make it work in all devices. I need some guidance from someone who has already have worked on this technology.

SweetWisher ツ
  • 7,296
  • 2
  • 30
  • 74

1 Answers1

0

Yeah, that line should solve the issue if your minSdkVersion is above 5.

And in the code you can check if the device supports NFC or not.

NfcAdapter nfcAdapter = nfcAdapter = NfcAdapter.getDefaultAdapter(this);

if (nfcAdapter == null) {       
    // This device doesn't support NFC.
}
if (!nfcAdapter.isEnabled()) {
    // NFC is Disabled
} else {
    // NFC is enabled
}
ThePCWizard
  • 3,338
  • 2
  • 21
  • 32
  • No issue at run-time..btw Thanx.. :) just need to check in manifest – SweetWisher ツ Nov 19 '13 at 05:47
  • I can't guarantee, because I never used that code. But as per the docs it should work perfect. Check these links: http://developer.android.com/guide/topics/manifest/uses-feature-element.html and http://stackoverflow.com/a/6475431/1405120 – ThePCWizard Nov 19 '13 at 05:50