You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/06/24 07:52:24 UTC

[GitHub] [cordova-plugin-camera] aximobile commented on issue #345: Camera plugin crashes app on some android phones when an image is taken

aximobile commented on issue #345:
URL: https://github.com/apache/cordova-plugin-camera/issues/345#issuecomment-648658317


   > > You are not right about the FILE_URI. The app can crash even when using FILE_URI! It's a matter of memory management from Android.
   > 
   > I may have caused some confusion in my past statements, but to be clear, I'm not saying `FILE_URI` will 100% solve the problem, but using it over `DATA_URL` will **significantly** help. Base64 explodes the memory usage by about 40%, it is an incredibly inefficient way to represent binary data. Which exacerbates memory usage issues on android and causes the activity to close when in the background. If you're using `DATA_URL`, then this is step 1 of solving the problem.
   > 
   > The next step is handling activity closures. If the activity is killed, it is up to the developer to handle resume. Which means they need to store whatever state necessary in a safe location so that they can return to that state on the `resume` event, should the activity be killed. Additionally, your camera results will be stored in the resume's event `pendingResult`. This is documented [here](https://github.com/apache/cordova-plugin-camera#android-quirks) and [here](https://cordova.apache.org/docs/en/dev/guide/platforms/android/index.html#retrieving-plugin-callback-results-cordova-android-510). This step is necessary to support all devices.
   
   How can we get to the 'resume' event if the app simply restarts ? 
   I would love to handle any app destroy but we just dont get there :(
   
   'Older' Android devices seem to have zero issues because of the fact that images have lower quality on these devices and therefore use less memory. 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org