Camera JSON error

766 views
Skip to first unread message

Luke Duncan

unread,
Mar 16, 2012, 11:24:00 AM3/16/12
to phonegap
When attempting to capture a picture from the camera on my app, I
receive a JSON error. I have updated to 1.5.0 just today, and I am
using the correct .js file. I've looked at the example packaged with
1.5.0 download and the same error appears. Any advice?

Johannes la Poutre

unread,
Mar 16, 2012, 5:34:34 PM3/16/12
to phon...@googlegroups.com
Same error here (Android 4.0.2 / Nexus Galaxy) in the example app.

Anyone a pointer to a starting point for debugging?

Vik

unread,
Mar 16, 2012, 7:15:09 PM3/16/12
to phon...@googlegroups.com
Same problem here. Android 2.3.6/Nexus One/PhoneGap 1.5

Kokesh

unread,
Mar 17, 2012, 2:06:17 PM3/17/12
to phon...@googlegroups.com
Same here (4.0.3/LG P500 Optimus One, Cordova 1.5.0) 


On Friday, March 16, 2012 4:24:00 PM UTC+1, Luke Duncan wrote:

Libby

unread,
Mar 17, 2012, 3:16:16 PM3/17/12
to phon...@googlegroups.com
If you're referring to the ancient demo app, and the Camera
"Get a Picture" function (not Capture API).. it's probably
because the default of pictureSource or destinationType 
(can't remember which one) has changed, and must be
set explicitly if it's not the one you want (probably good idea
to explicitly set anyway).

See Camera API docs for example of setting these values
before calling .getPicture().

My proposed new demo app has examples of camera and
capture (and all other APIs). Also on Android Market (free).

Libby

cole peterson

unread,
Mar 19, 2012, 12:13:04 PM3/19/12
to phonegap
Thanks so much!!!!

On Mar 17, 12:16 pm, Libby <libby.bald...@gmail.com> wrote:
> If you're referring to the ancient demo app, and the Camera
> "Get a Picture" function (not Capture API).. it's probably
> because the default of pictureSource or destinationType
> (can't remember which one) has changed, and must be
> set explicitly if it's not the one you want (probably good idea
> to explicitly set anyway).
>
> See Camera AP<http://docs.phonegap.com/en/1.5.0/phonegap_camera_camera.md.html#Camera>I
> docs for example of setting these values
> before calling .getPicture().
>
> My proposed new demo app <https://github.com/libbybaldwin/phonegap-api-demo>has examples of camera and
> capture (and all other APIs). Also on Android Market<https://play.google.com/store/apps/details?id=com.mds.phonegapapi>(free).

Raymond Camden

unread,
Mar 21, 2012, 9:51:09 AM3/21/12
to phon...@googlegroups.com
Just a quick thank you Libby - this has been bugging me for a while. FYI, it's destinationType that is now required.

yimingwuzere

unread,
Mar 22, 2012, 4:12:53 AM3/22/12
to phon...@googlegroups.com
In cordova-1.5.0.js, change the line
    var destinationType = Camera.DestinationType.FILE_URL;
to
    var destinationType = Camera.DestinationType.FILE_URI;

There's a typo in the .js file.

Libby

unread,
Mar 22, 2012, 1:17:32 PM3/22/12
to phon...@googlegroups.com
Wow, good catch! Did you file an issue for it?  That explains why
setting explicitly each time works better :)

Libby

Libby

unread,
Mar 24, 2012, 1:23:55 PM3/24/12
to phon...@googlegroups.com
Create Issue CB-383.  Affects default destinationType if not set explicitly.

Simon MacDonald

unread,
Mar 24, 2012, 2:04:07 PM3/24/12
to phon...@googlegroups.com
This has already been fixed for 1.6 and I will close CB-383.

Simon Mac Donald
http://hi.im/simonmacdonald


--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com

Reply all
Reply to author
Forward
0 new messages