Can I Get Access To Nfc Without Manifest Permission In Android?
Solution 1:
Updated as per finding of thorbear
The uses-feature
element so that your application shows up in Google Play only for devices that have NFC hardware:
<uses-featureandroid:name="android.hardware.nfc"android:required="true" />
If your application uses NFC functionality, but that functionality is not crucial to your application, you can omit the uses-feature element and check for NFC avalailbility at runtime by checking to see if getDefaultAdapter() is null.
This is not possible without adding permission into manifest. And you do not required to create two apps for such case.
Read Requesting NFC Access in the Android Manifest for more details
But yes you have a way to say "My application uses NFC feature but optional".
For this you need to add <uses-feature android:name="android.hardware.nfc" android:required="false" />
into manifest. So Google play can make your application available for all devices which have NFC
or not have.
Note : If you do not add this <uses-feature .../>
tag into manifest with android:required="false"
, Google Play will treat your application as "this application is only for devices which having NFC". And a device which does not have NFC
feature, can not download your application from Google Play.
Here is manifest example
<manifest...><uses-featureandroid:name="android.hardware.nfc"android:required="true" /><uses-permissionandroid:name="android.permission.NFC" /></manifest>
Read more about <uses-feature>
Solution 2:
You can't get access to NFC without adding the following permission to your manifest.
<uses-permissionandroid:name="android.permission.NFC" />
Post a Comment for "Can I Get Access To Nfc Without Manifest Permission In Android?"