Android Open Source - android.widget Camera Utils






From Project

Back to project page android.widget.

License

The source code is released under:

Apache License

If you think the Android project android.widget listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package me.dm7.android.widget;
//www  .ja v  a  2  s  .  c o  m
import android.hardware.Camera;

public class CameraUtils {
    /** 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
    }

}




Java Source Code List

me.dm7.android.widget.BarcodeScannerView.java
me.dm7.android.widget.CameraPreview.java
me.dm7.android.widget.CameraUtils.java
me.dm7.android.widget.DisplayUtils.java
me.dm7.android.widget.ViewFinderView.java