If your array is not too large, I agree with theSmith, using
SharedPreferences is very easy if you are not sure about how to use
other data storage approaches. If you store it as a String you could
then parse it and rebuild the array.

If you have a lot of data, you might want to go ahead and check out
using a database. Here is a quick database example I wrote recently,
in case it helps: http://www.screaming-penguin.com/node/7742.

Also, here are some examples of writing and reading to files:
http://unlocking-android.googlecode.com/svn/chapter5/trunk/FileStorage/src/com/msi/manning/chapter5/filestorage/.
See "CreateFile" for writing to a file, and "ReadFile" for reading the
data back. These are a bit simplified, and the process is pretty raw,
but the concepts are there.

HTH


On Jan 19, 8:25 pm, Jeffrey <[email protected]> wrote:
> How do I save the contents of an array to a file and then read it
> again later? I have a small amount of data that will need to be stored
> and since I have no idea where to start on using a SQLite database, I
> think this will work a lot better.
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to