android Programming Glossary: cameraid
Android Camera Preview Rotation http://stackoverflow.com/questions/10385147/android-camera-preview-rotation android.hardware.Camera.getCameraInfo cameraId info int rotation activity.getWindowManager .getDefaultDisplay..
Rotating phone quickly 180 degrees, camera preview turns upside down http://stackoverflow.com/questions/19532599/rotating-phone-quickly-180-degrees-camera-preview-turns-upside-down controlInflater null private Sensor mOrientaion1 int cameraId 0 public final String TAG CustomCamera private SensorManager.. camera.startPreview setCameraDisplayOrientation this cameraId camera previewing true catch Exception e e.printStackTrace.. void setCameraDisplayOrientation Activity activity int cameraId android.hardware.Camera camera android.hardware.Camera.CameraInfo..
switch back/front camera on fly http://stackoverflow.com/questions/6599454/switch-back-front-camera-on-fly stopCamera super.onPause private void startCamera int cameraId if camera null stopCamera holder cameraView.getHolder listener.. int width int height holder.addCallback listener camId cameraId camera Camera.open cameraId Camera.Parameters params camera.getParameters.. listener camId cameraId camera Camera.open cameraId Camera.Parameters params camera.getParameters if cameraId Camera.CameraInfo.CAMERA_FACING_BACK..
Android Camera Preview Rotation http://stackoverflow.com/questions/10385147/android-camera-preview-rotation android.hardware.Camera.CameraInfo info new android.hardware.Camera.CameraInfo android.hardware.Camera.getCameraInfo cameraId info int rotation activity.getWindowManager .getDefaultDisplay .getRotation int degrees 0 switch rotation case Surface.ROTATION_0..
Rotating phone quickly 180 degrees, camera preview turns upside down http://stackoverflow.com/questions/19532599/rotating-phone-quickly-180-degrees-camera-preview-turns-upside-down surfaceHolder boolean previewing false LayoutInflater controlInflater null private Sensor mOrientaion1 int cameraId 0 public final String TAG CustomCamera private SensorManager sensorManager @Override public void onCreate Bundle savedInstanceState.. false if camera null try camera.setPreviewDisplay holder camera.startPreview setCameraDisplayOrientation this cameraId camera previewing true catch Exception e e.printStackTrace public static void setCameraDisplayOrientation Activity activity.. true catch Exception e e.printStackTrace public static void setCameraDisplayOrientation Activity activity int cameraId android.hardware.Camera camera android.hardware.Camera.CameraInfo info new android.hardware.Camera.CameraInfo android.hardware.Camera.getCameraInfo..
switch back/front camera on fly http://stackoverflow.com/questions/6599454/switch-back-front-camera-on-fly camId super.onResume @Override protected void onPause stopCamera super.onPause private void startCamera int cameraId if camera null stopCamera holder cameraView.getHolder listener new Callback @Override public void surfaceDestroyed SurfaceHolder.. public void surfaceChanged SurfaceHolder holder int format int width int height holder.addCallback listener camId cameraId camera Camera.open cameraId Camera.Parameters params camera.getParameters if cameraId Camera.CameraInfo.CAMERA_FACING_BACK.. SurfaceHolder holder int format int width int height holder.addCallback listener camId cameraId camera Camera.open cameraId Camera.Parameters params camera.getParameters if cameraId Camera.CameraInfo.CAMERA_FACING_BACK params.setPreviewSize 1280..
|