SoFunction
Updated on 2025-04-06

Android determines whether the device has a camera instance code

PackageManager can be used to determine whether the Android device has a camera

PackageManager pm = getPackageManager();
// FEATURE_CAMERA - Rear camera// FEATURE_CAMERA_FRONT - Front cameraif (!(PackageManager.FEATURE_CAMERA)
&& !(PackageManager.FEATURE_CAMERA_FRONT)) {
	("camera", "non-support");
} else {
	("camera", "support");
}

The above example code for determining whether the device has a camera is all the content I share with you. I hope you can give you a reference and I hope you can support me more.