uses-feature
declares what types of hardware/software availability your app uses. You can use this to automatically narrow down what types of devices it will appear to. You can declare any of these features as optional, if the app is able to still function without them, and is designed to handle situations in which the feature is unavailable (such as with the Nexus 7 as you mentioned).
uses-permission
declares what types of functions your app is allowed to use. If you declare the permission, as you've done, it lets the user know "Hey, this app is allowed to use my camera" and they can decide whether or not to approve that usage. You cannot mark a permission as optional.
You should instead leave the required
attribute off of the uses-permission
tag, and add another tag for the camera with uses-feature
, and in that tag, mark it as required="false"
. For example:
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera" android:required="false"/>
EDIT: Reading this document, it appears you may also have to add:
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
since the camera permission implies the requirement of these two features. It may work without this extra tag, but it probably wouldn't hurt to be over-specific, just in case.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…