cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thehuijb <>
Subject [GitHub] cordova-plugin-camera pull request: CB-8804 implement check for sa...
Date Mon, 22 Jun 2015 09:42:59 GMT
Github user thehuijb commented on the pull request:
    ## How a cordova camera application works on android
    This is basically  how a cordova application works:
    - User presses App-icon
    - Applications start
    - Mainactivity start
    - Java side of plugins included
    - WebView initialized
    - Html loads
    - javascript side of plugins loaded
    - onDeviceReady fired
    Now we have our application up and running.
    It’s time to take a picture
    - We call getPicture
    - The call goes to the CordovaBridge
    - CordovaBridge uses the PluginManager to pass it to the camera Plugin
    - Camera plugin launches a camera Activity
    Now that a camera Activity is running, our MainActivity is pushed to the background, onPause
is fired.
    When the Camera Activity finished the MainActivity is called again via onActivityResult
    the result is dispatched to the javascript succesFunction where our application can then
do with it as planned.
    That’s what happens in a high memory availability scenario, a happy flow.
    Now what happens when there isn’t enough memory left and the OS decides to kill our
    - CameraActivity is finished and sends its result back to the activity that launched it.
    - Our MainActivity, is started.
    - Java side of plugins included
    - onActivityResult fires
    - plugin fails to send result back to the javascript because it is not there anymore
    - a completely new WebView is initialized
    - Html loads
    - javascript side of plugins loaded
    - onDeviceReady fired
    the precise order of event could differ on occasion but that doesn’t matter because
the entire webview has to be rebuilt and with it all the javascript therefor the callback
can never be completed in this situation.
    You will always have to call a method in (or after) onDeviceReady to solve this problem.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message