cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Grieve <>
Subject Re: [Android] - State, Plugins and the Android Lifecycle
Date Thu, 08 Nov 2012 02:23:56 GMT
I'm playing the noob card on this one, as I've never built an Android app.
Is the problem that Android can kill our webview when it's not the primary
view, and that we can't restore its state afterwards? I read that there's
some property bag that the system gives app to store their state in when
this happens. Is it that we don't currently expose this lifecycle to the
app, but we need to? It'll be annoying to tell devs that they must be able
to serialize their state and be re-launched to it at any point in time, but
really, that's the  case for native android apps, so it's no worse.

On Wed, Nov 7, 2012 at 6:16 PM, Filip Maj <> wrote:

> I would be in favor of using android's state objects as much as possible
> and let the android os take over for restoring most of that shit. How that
> plays with webview/webkit I guess is another question entirely.
> On 11/7/12 2:53 PM, "Joe Bowser" <> wrote:
> >Hey
> >
> >I think that we really need to figure out what's going on in DroidGap.  I
> >know that this isn't a sexy new feature like WebRTC or anything, but we
> >need to figure this out.  Right now, we have the following problem:
> >
> >1. User uses a plugin that fires an intent and launches an external
> >activity
> >2. That activity takes up memory and closes DroidGap
> >3. When we get back to DroidGap, we can't recover the state, and as such
> >as
> >we can't get the camera
> >
> >Now, while this is primarily with Camera, this might be with other things
> >as well (i.e. BarcodeScanner, Camera with Video) and we should really
> >clean
> >up our lifecycle issues instead of trying to bring all these inside.
> >Also,
> >for the CordovaWebView people, we are going to have to figure out a way to
> >handle this lifecycle but make it easy for them to deal with these
> >changes.
> >
> >I propose that we start working on an CordovaActivity feature that cleans
> >out DroidGap and brings sanity to the world so that we can try to save and
> >restore the instance states and hopefully make things a bit more robust.
> >I
> >can't guarantee that we'll get everything, but I think this approach at
> >the
> >very least will lead to cleaner code, and more tests.
> >
> >Any thoughts about the Android Lifecycle and the state of DroidGap?
> >
> >Joe

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message