Aju
Aju

Reputation: 4599

Image taken with custom camera using surfaceview on android 4.0 powered devices(like Galaxy s3) is showing less resolution

I am developing an app, in that I am using Surfaceview and Camera api to take picture. My problem is the resolution of Image taken using Galaxy S3 is showing only 640x480. But in other devices it is showing the resolution as per the camera. Because of this when I display the Image it is coming blurred, only in S3, In other devices it is displayed perfectly.

I don't know what is the problem behind this. Other devices are running on 2.3 and s3 is on 4.0. Please help me.

Upvotes: 1

Views: 1137

Answers (1)

Different devices have different resolutions available.

You can find what picture sizes are supported when you set the camera in your class that extends Surfaceview:

public void setCamera(Camera camera) {
    this.mCamera = camera;
    if (mCamera != null) {
        List<Camera.Size> mSupportedPictureSizes = Camera.getParameters().getSupportedPictureSizes();
        //Iterate over list and find the size you want.
        Camera.Parameters parameters = mCamera.getParameters();
        parameters.setPictureSize(chosenPictureSize.width, chosenPictureSize.height);
        mCamera.setParameters(parameters);
    }

}

Upvotes: 1

Related Questions