Take pictures vertically
if (Integer.parseint (Build.VERSION.SDK) >= 8) {
Camera.setdisplayorientation (90);
} else {
if (Getresources (). GetConfiguration (). Orientation = = configuration.orientation_portrait) {
Parameters.set ("Orientation", "portrait");
Parameters.set ("Rotation", 90);
}
if (Getresources (). GetConfiguration (). Orientation = = Configuration.orientation_landscape) {
Parameters.set ("Orientation", "landscape");
Parameters.set ("Rotation", 90);
}
}
Get vertical Orientation Photo
Bitmap Bitmap = bitmapfactory.decodebytearray (data, 0, params[0].length);
Matrix matrix = new Matrix ();
Matrix.setrotate (90);
Bitmap = bitmap.createbitmap (bitmap, 0, 0, bitmap.getwidth (), Bitmap.getheight (), Matrix, True);
FileOutputStream fos = new FileOutputStream (Picture.getpath ());
Bitmap.compress ( Bitmap.CompressFormat.JPEG, N, FOS);
Fos.close ();