I think the trouble here is that the web side can't be stored in the same
way. If the webview is shut down and recreated, even if we maintain the
native side's state perfectly, the callback that was waiting for that
picture is lost. I'm not sure how we could start to solve that. Maybe by
trying to serialize everything to localstorage or something, but that's
probably way too long and the app would get killed first.


On Wed, Nov 7, 2012 at 9:23 PM, Andrew Grieve <[email protected]> wrote:

> 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 <[email protected]> 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" <[email protected]> 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
> >
> >
>

Reply via email to