Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.hardware.Camera;

public class Main {
    private static Camera camera;

    public static Camera getCameraInstance() throws Exception {
        if (camera == null) {
            camera = Camera.open(); // attempt to get a Camera instance
        }
        return camera; // returns null if camera is unavailable
    }
}