There is the use-permission and use-feature like below:
<uses-permission android:name="android.permission.CAMERA" android:requiredFeature="false"/>
<uses-feature android:name="android.hardware.camera" android:required="false"/>
I am just not quite clear about the "android:requiredFeature" attribute. Is it the same effect as the "android:required" in use-feature? I just cannot find the android:requiredFeature related infomation in the android developer site and google....
Specifies a system permission that the user must grant in order for the app to operate correctly. Permissions are granted by the user when the application is installed (on devices running Android 5.1 and lower) or while the app is running (on devices running Android 6.0 and higher).
Using "permission" element in android manifest file, we can define a permission. This permission can be added to permission-group. if we name this permission-group as "com.
Yes more or less both have the same effect. android:requiredFeature
is only used in API level 26 and higher if your app has minSdkVersion
less than 26 the application will simply ignore the attribute.
<uses-permission>
generally is used to specify a permission that a user must grant for the app to run correctly, it is not necessarily used to filter the app for devices on Google Play. If you want your app to be filtered for devices based on the hardware feature your app uses, the recommended way is to define <uses-feature>
element in your manifest.
As mentioned in the other answer, based on <uses-permission>
Google play can assume that your app requires the underlying hardware feature and it can filter your app based on that, but its not always true, your app might work without that hardware feature but it prefers to have that feature, So to avoid filtering based on <uses-permission>
, android:requiredFeature
attribute is used to enhance your control over the filtering.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With