Kevin L. Kevin L. - 1 month ago 34
Java Question

Uses-Permission vs Uses-Feature

I've seen many specific cases of people asking and people explaining the difference between the two but I can't and don't seem to understand the general difference. Are the two synonymous? Does one imply the other?

Answer

Are the two synonymous?

No. <uses-permission> says "hey, Android (and associated distribution channels), please ask the user to allow me to do X". <uses-feature> says "hey, Android (and associated distribution channels), I am interested in running on hardware with feature Y".

<uses-feature> may filter you out of the Play Store (and other channels), if the hardware does not meet your requirements, but the user doesn't get involved.

Does one imply the other?

Sometimes. If you request certain permissions, like CAMERA, Android assumes by default that you need the corresponding hardware. You can use <uses-feature> and android:required="false" to override that default behavior, if needed.