cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CB-8804)
Date Mon, 22 Jun 2015 09:43:00 GMT


ASF GitHub Bot commented on CB-8804:

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.

> --------------------------------------------------------------
>                 Key: CB-8804
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Plugin Camera
>         Environment: Android
>            Reporter: Serge Huijben
> Android Quirks
> Android uses intents to launch the camera activity on the device to capture images, and
on phones with low memory, the Cordova activity may be killed. In this scenario, the image
may not appear when the Cordova activity is restored.
> It can be solved bij implementing this PR:

This message was sent by Atlassian JIRA

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

View raw message