Code example for PackageManager

Methods: hasSystemFeature

0
	 */ 
	public static boolean deviceHasCamera(Context context) {
 
		PackageManager pm = context.getPackageManager();
 
		if (pm.hasSystemFeature(PackageManager.FEATURE_CAMERA)) {
			return true; 
		} else { 
			return false; 
		} 
	} 
 
	/** 
	 * Checks that the device supports Camera supports auto focus. 
	 *  
	 * @param Context 
	 *            context - The calling activity's context. 
	 * @return boolean - True if it supports otherwise false. 
	 */ 
	public static boolean deviceCameraHasAutofocus(Context context) {
Experience pair programming with AI  Get Codota for Java