Skip to content Skip to sidebar Skip to footer

Android Camera GetSupportedPreviewSizes() Error

I am testing my Android app on a Samsung Galaxy Tab. When I open up the camera application on the tablet, I see that the possible resolutions you can set for the camera are: 2560

Solution 1:

Why is there such a discrepancy in the supported resolutions?

Picture resolutions and preview resolutions are not the same thing. The former is for pictures. The latter is for the preview frames.

I want my custom camera activity to have a full screen camera, and I can't do it with resolutions that are smaller than the screen size (which my app says is 800 x 1344).

Yes, you can. Android will happily stretch or shrink your preview frames to match the size of the TextureView or SurfaceView that you are using for the preview. In fact, such stretching or shrinking is pretty much unavoidable, since it is rather unlikely that the camera will support some arbitrary preview resolution, one that happens to match whatever you are choosing for your preview View size.


Post a Comment for "Android Camera GetSupportedPreviewSizes() Error"