Hiromi
Hiromi

Reputation: 229

Camera api preview not showing

I'm trying to implement my own camera without using the camera intent.

When I try to setPreviewSize() from the camera.getParameters().getSupportedPreviewSizes() highest resolution it doesn't display the preview on some devices. It work for the majority but not all...

This is my res supported list

SIZE 1280 960 SIZE 1280 720 SIZE 800 480 SIZE 720 720 SIZE 720 480 SIZE 640 480 SIZE 352 288 SIZE 320 240 SIZE 176 144

Not working for 1280 * 960 but ok for 1280 * 720 for this specific device. Is it kind of magical or something :-/

Tcs for help !

Upvotes: 0

Views: 185

Answers (1)

gustavogbc
gustavogbc

Reputation: 715

First of all, note the official recommendation on https://developer.android.com/reference/android/hardware/Camera.Parameters.html:

This class was deprecated in API level 21.
We recommend using the new android.hardware.camera2 API for new applications.

Now, could you please be more specific on which devices doesn't it work? It seems like it is not your fault since some devices simply just won't support every resolution.

Upvotes: 1

Related Questions