Android examples for android.hardware:Camera Orientation
adjust Camera Orientation
import android.content.Context; import android.content.res.Configuration; import android.hardware.Camera; public class Main { public static void adjustCamera(Context context, Camera camera) { if (context.getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE) { // parameters.set("orientation","portrait"); camera.setDisplayOrientation(90);/*from w ww. j a v a2 s . com*/ } else { // parameters.set("orientation","landscape"); camera.setDisplayOrientation(0); } } }