But do I apply my desired resolution on the preview object (android.view.SurfaceView) or on the camera parameter object (android.hardware.Camera.Parameters)?
getSupportedPictureSizes()
is for pictures. You update the Camera.Parameters
via setPictureSize()
to indicate what Camera.Size
you want for the actual picture taken via takePicture()
.
getSupportedPreviewSizes()
is for preview frames. You update the Camera.Parameters
via setPreviewSize()
to indicate what Camera.Size
you want for the preview frames. You probably also want to set up your Surface
to be the same size, or at least the same aspect ratio, so the image does not get stretched or squished.
And, FWIW, you may find my CWAC-Camera library easier to use than the native Camera
API.