Check if Android Device has Camera via Code
by Sasikumar[ Edit ] 2014-04-29 16:03:54
To check if a device has camera in android use the following code,
Context myContext = this;
PackageManager myPackageManager = myContext.getPackageManager();
TextView myTextView = (TextView) findViewById(R.id.infodisplay);
if (myPackageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA)) {
myTextView.setText("Camera is available");
} else {
myTextView.setText("Camera not available");
}