get Camera id array - Android android.hardware

Android examples for android.hardware:Camera ID

Description

get Camera id array

Demo Code

import android.hardware.Camera;

public class Main {

  public static int[] getCameraIds() {
    int count = Camera.getNumberOfCameras();
    int[] idArray = new int[count];
    for (int i = 0; i < count; i++) {
      idArray[i] = i;/*from   w w  w  .  j  a  v a 2  s  .  c o  m*/
    }
    return idArray;
  }

}

Related Tutorials