Search code examples
androidandroid-hardware

How to make sure an android device application supports hardware feature


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


Solution

  • Add this to your manifest:

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

    uses-feature tag