Search code examples
androidandroid-camerarhomobile

Android Camera Preview is incorrect on Samsung Galaxy S3


When I load the camera in my app with a Samsung Galaxy S3 on Android 4.0.4, the preview image is just green and fuzzy with horizontal noise. The camera button looks fine. When I take the picture, the saved file looks good. I tested the build in camera app and it works just fine.

This issue does not happen on a Samsung Galaxy S and Motorola Electrify running Android 2.3.

I use Rhomobile for development. Here is a link to the Android camera source code: https://github.com/rhomobile/rhodes/tree/master/platform/android/Rhodes/src/com/rhomobile/rhodes/camera

This is what I get when I bring up the camera: enter image description here

My setup: - Samsung Galaxy S3 on Android 4.0.4 - Rhodes 3.4.2 - minSDK: 8 - Android SDK: 4.1


Solution

  • I fixed this problem by changing my camera setting from:

    settings = {:desired_width => 800, :desired_height => 800, :flash_mode => 'auto'} Camera::take_picture(url_for(:action => :camera_callback_new), settings)

    to

    settings = {:desired_width => 1024, :desired_height => 1024, :flash_mode => 'auto'} Camera::take_picture(url_for(:action => :camera_callback_new), settings)