get All Camera Ids - Android Camera

Android examples for Camera:Camera Attribute

Description

get All Camera Ids

Demo Code


import android.annotation.TargetApi;
import android.hardware.Camera;
import android.os.Build;

public class Main{
    private static final int numberOfCameras;
    public static String[] getAllCameraIds() {
        String[] ids = new String[numberOfCameras];
        for (int i = 0; i < ids.length; i++) {
            ids[i] = "" + i;
        }//from   w w w  . ja v a  2  s. c  om
        return ids;
    }
}

Related Tutorials