Skip to content Skip to sidebar Skip to footer

Camera Example From The Docs Page Fails On Android 2.3.x

I am creating a phonegap app for captureing photo in android phones. Its working fine for android 4.x. but not working for android 2.3.x got an error like this: Sorry! The applicat

Solution 1:

The default Phonegap (Cordova) Camera Plugin calls the native camera and this makes Android Garbage Collector to kill background applications. This plugin avoid your application to go background and be killed by Garbage Collector with other applications. We used the Phonegap source code and modified it to avoid this problem. This plugin works only with File URI.

Foreground Camera Plugin for Phonegap

Solution 2:

Instead of destinationType.FILE_URI use Camera.DestinationType.FILE_URI

See following code

navigator.camera.getPicture(onPhotoDataSuccess,onFail, { quality:50, destinationType:Camera.DestinationType.FILE_URI });

It works for me on 2.3.x as well as on 4.x

Hope this helps.

Post a Comment for "Camera Example From The Docs Page Fails On Android 2.3.x"