Question

I am developing an application which uses camera extensively. What I wish to do is that if a device or tablet does not have camera it my application should not get installed on it.

Checked the <uses-feature> in android manifest but only checks when application is installed via android marketplace. What if I intend it to be also available my site. So is there a way I can handle this so that application should not get installed in case device does not have a camera hardware?

Thanks, ~nil

Was it helpful?

Solution

Add this to your manifest:

   <uses-feature android:name="android.hardware.camera" android:required="true" />

uses-feature tag

OTHER TIPS

You can use code to check device support feature :
PackageManager pm = getPackageManager();
if (!pm.hasSystemFeature(PackageManager.FEATURE_SENSOR_COMPASS)) {
    // This device does not have a compass, turn off the compass feature
    disableCompassFeature();
}
preference link : http://developer.android.com/guide/practices/compatibility.html#Features
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top