I'm trying to get the camera api2 working on Android 4.4.2 based on the following slides. http://www.slideshare.net/lbk003/an-devcon2013-camera3kaurfinal
However, the function getCameraIdList() returns an empty array with 'no devices; exception. I tried this on my google glass running Android 4.4.2 and also on an emulation of a nexus 5 running Android 4.4.2 with camera emulation enabled. Both gave the same error. Google glass camera api1 gives me access to the camera.
mCameraManager = (CameraManager) ctx.getSystemService("camera");
try {
String[] devices = mCameraManager.getCameraIdList();
if (devices == null || devices.length == 0) {
throw new ApiFailureException("no devices");
}
I also have the following two lines in the manifest file.
uses-permission android:name="android.permission.CAMERA"
uses-feature android:name="android.hardware.camera"
Has anyone been successful in using the hidden camera api2 in Android 4.4.2?