Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Camera Preview Size Hardcoded #10

Open
copperstick6 opened this issue May 30, 2017 · 2 comments
Open

Camera Preview Size Hardcoded #10

copperstick6 opened this issue May 30, 2017 · 2 comments
Assignees

Comments

@copperstick6
Copy link

In Line 211 of Main Activity.js, there's a hardcoded value for setting the camera size. We think this is causing a lot of crashes with devices which do not support said resolution. A recommended solution is to grab the device's size and set that as the size of the preview size. This would remove the error.

mCameraSource = new CameraSource.Builder(this, barcodeDetector)     
                .setFacing(CameraSource.CAMERA_FACING_BACK)    
                .setRequestedPreviewSize(1600, 1024)     
                .build();     
    } 
@ThomasGaubert
Copy link
Contributor

For what it's worth: https://developers.google.com/android/reference/com/google/android/gms/vision/CameraSource.Builder#public-methods

If the exact desired values are not available options, the best matching available options are selected.

@copperstick6
Copy link
Author

copperstick6 commented May 31, 2017

Thanks Thomas! I'm pinging Lucy about the sizes of the devices that we're planning to use at this year's event so that we can build around that. Changing this from bug to enhancement since it's not causing immediate issues when I create a build with a device with those dimensions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants