<uses-feature> 主要还是被Play使用的.例子:
<uses-feature android:name="android.hardware.touchscreen" android:required="true"/>
如果设备没有这个touchscreen这个硬件,
play就不会把app安装到这个设备上.false的话还是会安装上.
Android apps can declare hardware feature requirements in the app manifest to ensure that they do not get installed on devices that do not provide those features. If you are extending an existing app for use on TV, closely review your app‘s manifest for any hardware requirement declarations that might prevent it from being installed on a TV device.
Some features have subfeatures like android.hardware.camera.front, as described in the Feature Reference. Be sure to mark as required="false" any subfeatures also used in your app.
舉例來說,我的App會使用到Camera,但不是必要的。為此我宣告了Camera的<uses-permission>,但省略了<uses-feature>。
<uses-permission android:name="android.permission.CAMERA" />
此時Google Play發現了這個<uses-permission>,便會將Camera視為必要而進行過濾,沒有Camera的裝置就看不到我的App了,這樣跟我想要的結果不同。设置为false就没有这个问题了!
另外, App内部也可以判断是否支持这个硬件
// Check if the camera hardware feature is available. if (getPackageManager().hasSystemFeature("android.hardware.camera")) { Log.d("Camera test", "Camera available!"); } else { Log.d("Camera test", "No camera available. View and edit features only."); }