How to determine an android device whether supports "android.hardware.camera.autofocus"?
From where I can get a feature list supported by this android device?
I want to use feature in my app, but I don't know if the phone supports or not.
<uses-feature
android:name="android.hardware.camera"
>
</uses-feature>
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="true"
>
</uses-feature>
you can manage like
PackageManager pm = getPackageManager();
if (pm.hasSystemFeature(PackageManager.FEATURE_CAMERA)) {
// Here if you get Camera Do you work Like
Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
i.putExtra(MediaStore.EXTRA_OUTPUT,MyFileContentProvider.CONTENT_URI);
startActivityForResult(i, CAMERA_RESULT);
} else {
Toast.makeText(getBaseContext(), "Camera is not available",Toast.LENGTH_LONG).show();
}
also Add Require Permission of Camera to AndroidManifest.xml file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With