Fwiw, to me a SQLite database for storing a game save is way overkill.  If
the state is simple, use SharedPreferences.  If it is more complicated, just
put it in a flat file.

On Sat, Nov 13, 2010 at 11:59 AM, TreKing <treking...@gmail.com> wrote:

> 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<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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