Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I have to use the accelerometer in Android to get my photos to orient correctly?

I notice that when you take photos with the native camera app, they come out portrait or landscape (as they should), however, when I take photos in my app using the Camera class, they are always landscape, no matter how I'm holding the device.

I'm really hoping I don't have to monitor the orientation of the device and manually rotate the images... is there a less silly way to get this done?

TIA

like image 392
Yevgeny Simkin Avatar asked Nov 13 '22 17:11

Yevgeny Simkin


1 Answers

You dont need to use accelerometer. You can just check the orientation by the time the photo is taken. Developer Android

getResources().getConfiguration().orientation
like image 150
Murat Avatar answered Dec 23 '22 09:12

Murat