On Oct 31, 12:17 pm, Dianne Hackborn <hack...@android.com> wrote:
> On Sun, Oct 31, 2010 at 11:12 AM, Mark Murphy <mmur...@commonsware.com>wrote:
>
> > On Sun, Oct 31, 2010 at 2:07 PM, Dianne Hackborn <hack...@android.com>
> > wrote:
> > > As far as using Application to clean up statics -- this simply doesn't
> > > really make sense, for the reasons above.  For a legacy application with
> > > statics that can't be re-used again in the same process, your only choice
> > is
> > > probably to just self-kill your process when the user leave the game.
> > Wait, what? I was under the distinct impression we should not be
> > killing processes this way.
>
> You should not be, but if you have a bunch of legacy code that can't cleanly
> work without doing so...  well, sometimes you need to compromise.  This does
> have other negative consequences, so nobody writing Android applications
> should do this.
>
> Games, though, games are sometimes so special.

Yes, and those special games sometimes rely on existing libraries that
a developer can't control. I just was made aware of this thread by
Mark; thanks for clarifying that what I'm doing is valid, if
undesirable. I can detect a restart when it happens (as I've described
on the NDK list), but the problem is that the client library has a lot
of state in a singleton and resetting it without breaking it might
be ... complex.

Honestly I'd rather find a way to fix the underlying static reset
issue(s), but I don't want to throw a lot of hours at it without
approval (being paid by the hour). And a kill of the app in onStop()
makes the problem go away; in onDestroy() it would be too late, since
the next instance has (typically) already been created by then. I may
spend a few hours to see if I can find any other relevant statics that
need cleaning up, but more than that and I'd need the client to tell
me they really care whether it's being done the "right" way.

On the plus side, it runs great on Android, and the client's happy.
Sometime in December there will be another popular iPhone game
released on Android, if all goes well, and it will be my first Android
release (of many, I hope!). :)

Tim

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to