I have taken NFC permission in AndroidManifest.xml
and I uploded my app to PlayStore. Now My question is, if device doest not support NFC and I try to install app
from playstore. Does it gives an any kind of error? Does app
atleast install on that device. I don't have any non supported NFC devices to test this situation.
device doesn't not support NFC and I try to install app from playstore. Does it give any kind of error?
Play Store won't give any error and will let the users install the app, if you have not mentioned the relevant uses-feature
tag in manifest file. Now, once installed, while trying to get NfcManager
instance, it'd be null. Refer to this doc on how to request NFC access.
NfcManager manager = (NfcManager) context.getSystemService(Context.NFC_SERVICE); // null
The better practice, here, is that we should include uses-feature
in manifest file to let Play Store know that our app has certain hardware dependency and we don't want the app to be available for the devices which do not consist of this set of hardware(defined in uses-feature
tag).
For example:
<uses-feature
android:name="android.hardware.nfc"
android:required="true"/>