Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android portrait camera reliability

I'm developing an app targeted SDK 8 with min SDK 7 that uses a camera view.

Obviously there is this issue of rotating the Camera for portrait that has had a fair amount of discussion already. I currently have the following fix that separates SDK 7 and 8+:

if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.FROYO){
    theCamera.setDisplayOrientation(90);
} else {
    parameters.set("orientation", "portrait");
    parameters.set("rotation",90);
}

Which works on both a 2.1update1 device and an SGS2 I have (running ICS).

My question is, what kind of reliability do these solutions have across devices? I've seen a few solutions to the 'pre-froyo' situation, so I'm dubious of this solution working for all devices. I'm also wondering how well 'setdisplayorientation' is respected on different devices...

I'd be really grateful to hear of other's experience with this.


So some more info: How to set Android camera orientation properly? This explains that these methods work some of the time. So the further question from what point (SDK version) did setDisplayOrientation start working ALL of the time??

like image 938
Sam Avatar asked Jul 24 '12 19:07

Sam


People also ask

Does Android camera quality degrade over time?

Actually speaking the quality of the camera in the smartphone does not degrade it remains the same from the time it is purchased. The main thing what degrades is that the maintenance of the smartphone which degrades with time.


1 Answers

One weird solution, orientation will not be exactly same for all the devices. It is completely OEM dependent, can vary device to device(I have tried on many devices). You can't fix it simply. Show an Activity with Camera preview on first launch and just ask the user if the proposed rotation is what he wants and allow him to change it if not. Based on user selection, you can handle it.

like image 118
Daud Arfin Avatar answered Sep 17 '22 12:09

Daud Arfin