Monday, March 12, 2012

Fun Android camera gotcha

Android's camera object includes a method called takePicture which takes 3 callbacks as arguments:
1) shutter callback
2) raw callback
3) jpeg callback

The shutter callback occurs roughly when the shutter sound occurs in the stock camera.

Raw callback and jpeg callback occur when camera image data is available. Well, RAW > JPEG, right? So why not just implement RAW callback and skip JPEG callback? If you code up the RAW callback, you'll find that you can't get an image from the returned data. The object is non-null, but upon further inspection has zero length. What did I do wrong? you'll think. Actually, nothing, it just doesn't work. Never has. Yet it's still there in the libraries and in the documentation after years and years, without any note or anything that it doesn't freaking work. Huh? (typical Android).

1 comment:

Carol Bruns said...

Never thought such in deep about the Android camera, but being in development field it's great to know about this. I now finally know how one can take picture with Android and how it calls backs to its click.

Labels

Blog Archive

Contributors