Java tutorial
//package com.java2s; //License from project: Open Source License import android.hardware.*; import android.support.annotation.*; public class Main { @Nullable public static Camera getCamera() { Camera camera = null; try { camera = Camera.open(); } catch (Exception e) { e.printStackTrace(); } return camera; } }