I\'m getting a Fail to connect to camera service exception when I run my Android app in the emulator. I\'ve read the various existing posts but none have fixed this. It is
1.Use below permissions in manifest file and always put permissions above Application tag.
2.Use Unlock while camera used by other service like MediaRecorder.
camera.unlock();
recorder.setCamera(camera);
2.Released camera properly, I prefer to use lock so become safely accessible for other application and second time use (In case if we reopen).
if (camera != null) {
camera.lock();
camera.stopPreview();
camera.release();
camera = null;
}