@SHININGU wrote:
I'm having a pretty common issue on Ionic with Android (It's also
common in Cordova/PhoneGap) where on low ram devices, when you call the
camera to get a picture (or any media intent actually), your app goes
background and is often closed by the Garbage Collector, and then
restarted after the picture was taken.
This is the code I'm using to call the camera, with the ngCordova Camera
plugin:var options = { quality: 75, destinationType: Camera.DestinationType.FILE_URI, //destinationType: Camera.DestinationType.DATA_URL, sourceType: Camera.PictureSourceType.CAMERA, allowEdit: true, encodingType: Camera.EncodingType.JPEG, targetWidth: 200, targetHeight: 200, popoverOptions: CameraPopoverOptions, saveToPhotoAlbum: false }; // This causes the app to go background $cordovaCamera.getPicture(options).then(function (imageData) { // do something with the picture }, function (err) { // do something with the error });
I searched far and wide and there seem to be just 2 posible solutions:
Implementing your own inApp camera, so your app never goes
background.Saving your app state and restoring it after taking the
picture.For multiple reasons, I'm going for the later, saving and restoring
my app state, which of course includes retrieving the picture data the
camera is returning. After this long context desciption, this is my
actual question:How can I retrieve the imageData the camera is returning to my app?
I might be lacking some basic Android knowledge, but I believe the
Camera app is returning an Intent to my app, so I tried to recover it
with this WebIntent plugin, with no success at all.
Posts: 1
Participants: 1