if an application requests the CAMERA permission but does not declare a <uses-feature> element for android.hardware.camera, Android Market considers that the application: http://developer.android.com/guide/topics/manifest/uses-feature-element.htmlrequires a camera and should not be shown to users whose devices do not offer a camera.
If you don't want Android Market to filter based on a specific implied feature, you can disable that behavior. To do so, declare the feature explicitly in a <uses-feature> element and include an android:required="false" attribute. For example, to disable filtering derived from the CAMERA permission, you would declare the feature as shown below. <uses-feature android:name="android.hardware.camera" android:required="false" /> Checkout this link http://developer.android.com/guide/topics/manifest/uses-feature-element.html On Sat, Nov 26, 2011 at 8:37 AM, limtc <[email protected]> wrote: > I have a question: > > If I wanted to support a feature (says camera) but it is not necessary > (menu item removed if detected no), is it necessary to declare: > > <uses-feature android:name="string" android:required="false"/> > > I assume we can simply do this without declaring. Isn't it? Or is it > just good practice but not necessary? > > PackageManager packageManager = getPackageManager(); > if (! > packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA)) > menu.removeItem(R.id.camera); > > Thanks! > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

