JSON error capturing image in Phonegap | Android

04/25/2012 § Leave a comment

Here is solution for those who get JSON error, or some undefined…..
One thing to remember is to input FILE.URI, targetwidth and targetheight…. It took about one day before I found that the code was right, but only because of that i hadn’t included width and height it was failing.

Take in consideration that.
By the way we are using phonegap version 1.5.0 (or cordova as it called now)


navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality : 75,
destinationType : Camera.DestinationType.FILE_URI,
sourceType : Camera.PictureSourceType.CAMERA,
encodingType: Camera.EncodingType.JPEG,
targetWidth: 100,
targetHeight: 100 }
);

Good Luck

Advertisements

Tagged:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading JSON error capturing image in Phonegap | Android at EPILEPSY APP.

meta

%d bloggers like this: