Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is code to check if there is a camera ( <a href="https://developer.android.com/guide/topics/media/camera.html" rel="nofollow">https://developer.android.com/guide/topics/media/camera.html</a> ):</p> <pre><code>/** A safe way to get an instance of the Camera object. */ public static Camera getCameraInstance(){ Camera c = null; try { c = Camera.open(); // attempt to get a Camera instance } catch (Exception e){ // Camera is not available (in use or does not exist) } return c; // returns null if camera is unavailable } </code></pre> <p>From the Android Compatibility page ( <a href="https://developer.android.com/guide/practices/compatibility.html" rel="nofollow">https://developer.android.com/guide/practices/compatibility.html</a> ):</p> <blockquote> <p>Android 1.0 through 1.5 required a 2 megapixel camera with auto-focus. However, with version 1.6, Android devices were permitted to omit the auto-focus capability, though a (fixed-focus) camera was still required. Some apps such as barcode scanners do not function as well with cameras that do not auto-focus. To prevent users from having a bad experience with those apps, existing apps that obtain permission to use the Camera were assumed by default to require auto-focus. This allowed Google Play to filter those apps from devices that lack auto-focus.</p> </blockquote> <p>Looking at the API here: <a href="https://developer.android.com/reference/android/hardware/Camera.html#autoFocus%28android.hardware.Camera.AutoFocusCallback%29" rel="nofollow">https://developer.android.com/reference/android/hardware/Camera.html#autoFocus%28android.hardware.Camera.AutoFocusCallback%29</a></p> <p>It looks like they tell you to use a function that isn't present yet.</p> <p>Unfortunately it may not be possible to check if the camera has auto-focus in Android 1.6.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload