Tuesday, June 26, 2012

<uses-feature> tag and required attribute in Android

In this tutorial I am going to explain <uses-feature> tag with respect to camera. When writing an Camera application, first in manifest we need to add the permission as
<uses-permission android:name="android.permission.CAMERA"/>
Also, we can give additional requirements in manifest file like, only those devices which have Camera can install our Camera app by
<uses-feature android:name="android.hardware.CAMERA" required="true"/>
If required attribute is false, then if CAMERA is not there in the device, then also app will install but once we mention required attribute is true in uses-feature then if CAMERA is not in the device then we can't install the app in the device.