Re: [android-developers] Save and continue game

2010-11-12 Thread Frank Weiss
>
>
> There's no instance state if the user backs out of the application
> completely.
>
>
>
That's correct. My bad.

-- 
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

Re: [android-developers] Save and continue game

2010-11-12 Thread TreKing
On Fri, Nov 12, 2010 at 4:29 PM, Frank Weiss  wrote:

> I think it depends on the amount of state, the complexity of the app, and
> how persistent the state is supposed to be.


This smells like persistent storage to me:

On Fri, Nov 12, 2010 at 10:29 AM, acr  wrote:

> For example when someone exits I want them to be able to save and exit,
> then come back and click continue to pick up where they left off with all of
> the graphics in the right place, timer and score.
>

In the Android activity model, you don't really "exit" an app. So unless the
> user does a force stop, the activity will be able to restore the state via
> saved instance state.


There's no instance state if the user backs out of the application
completely.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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

Re: [android-developers] Save and continue game

2010-11-12 Thread Frank Weiss
I think it depends on the amount of state, the complexity of the app, and
how persistent the state is supposed to be. Saved instance state is a good
place to start. In the Android activity model, you don't really "exit" an
app. So unless the user does a force stop, the activity will be able to
restore the state via saved instance state. The advantage is it's easy to
implement, no need for files or DB. Shortcomings are data is lost on force
stop, and I suppose update. So the question becomes what persistence does
the game state need for various lifecycle events, such as:

rotate screen, onPause/onResume, force close, update, uninstall, etc.

You also may need to address how and when the game state IS reset.

hth

-- 
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

Re: [android-developers] Save and continue game

2010-11-12 Thread TreKing
On Fri, Nov 12, 2010 at 10:29 AM, acr  wrote:

> I looked at onSaveInstanceState android examples, but not sure if this is
> what I need or how to implement it in my case. Any help on this would be
> GREATLY appreciated. Thanks Al
>

You'll probably want some sort of persistent storage, like a database or
even XML or flat file if your data is simple enough.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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

[android-developers] Save and continue game

2010-11-12 Thread acr
Hi everyone, I have a puzzle game with a 7x7 grid of graphics, and a
timer, its just about ready to go. But I am stuck on how to go about
saving/continuing game.
For example when someone exits I want them to be able to save and
exit, then come back and click continue to pick up where they left off
with all of the graphics in the right place, timer and score.
I looked at onSaveInstanceState android examples, but not sure if this
is what I need or how to implement it in my case. Any help on this
would be GREATLY appreciated. Thanks Al

-- 
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