Changes

Jump to: navigation, search
no edit summary
Before attempting to access the camera on an Android device, it is essential that defensive code be implemented to verify the presence of camera hardware. This is of particular importance since not all Android devices include a camera.
The presence or otherwise of a camera can be identified via a call to the PackageManager.hasSystemFeature() method. In order to check for the presence of a front-facing camera, the code needs to check for the presence of the PackageManager.FEATURE_CAMERA_FRONT FEATURE_CAMERA_FRONT feature. This can be encapsulated into the following convenience method:
<pre>

Navigation menu