Skip to content

Instantly share code, notes, and snippets.

@DavidTPate
Created February 13, 2013 04:48
Show Gist options
  • Save DavidTPate/4942376 to your computer and use it in GitHub Desktop.
Save DavidTPate/4942376 to your computer and use it in GitHub Desktop.
private boolean hasCamera(Context context) {
if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA)) {
// this device has a camera
Log.d(TAG, "At Least one Camera Detected!");
return true;
} else {
// no camera on this device
Log.d(TAG, "No Cameras detected.");
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment