On Sat, Nov 13, 2010 at 10:25 AM, acr <acr...@gmail.com> wrote:

> I have a DB setup and ready to go, but Im not sure which data to capture/
> how to capture it, and how to restore it.
>

Which: whatever you need to save and restore.
How: if you already have a DB setup (I assume SQLite) there's plenty of
tutorials online on saving and restoring data from one


> I would think I'd have to save the 49 xy positions of the graphics and
> their types, the score and time remaining.
>

That sounds about right.


> I cant find anything clear on this that pertains to a game state.
>

All games are different and will require saving their game states
differently. You're not going to find one all-encompassing solution.

The basic idea should be along these lines though:

* Identify what data you want the user to be able to save and restore.
* Implement a save method that writes the relevant data to your DB
* Call this when your app is paused / stopped / destroyed
* Implement a load method that restores your game state from the saved DB
values
* Call this when your app is starting up in onCreate

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/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

Reply via email to