Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {
    public static Camera getCameraInstance() {
        Camera c = null;
        try {
            Log.d("debug", "Trying to open camera");
            c = Camera.open();
        } catch (Exception e) {
            // Camera is not available or doesn't exist
            Log.d("debug", "getCamera failed " + e.getMessage());
        }
        return c;
    }
}