[android-developers] Re: Saving the contents of an array

2010-01-21 Thread free1000
One way could be to use StringTokenizer Google for the java.util.StringTokenizer java class. Save your string array by concatenating the contents with eg: a comma to your prefs string Then read the string and use StringTokenizer to split the prefs string using the comma as the token, and load

[android-developers] Re: Saving the contents of an array

2010-01-20 Thread Jeffrey
Well, I'm needing to save potentially over 1000 values in about 12 or so arrays. I was kind of hoping that there was an easy way to save an array and then load it back without having to do a bunch of stuff to it. I'm not too experienced with programming so most of my knowledge comes from reverse

[android-developers] Re: Saving the contents of an array

2010-01-19 Thread theSmith
You may want to consider using the shared preferences instead of writing to a file, its pretty simple to use. http://developer.android.com/reference/android/content/SharedPreferences.html -theSmith On Jan 19, 8:25 pm, Jeffrey jeffisagen...@gmail.com wrote: How do I save the contents of an array

[android-developers] Re: Saving the contents of an array

2010-01-19 Thread Charlie Collins
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

[android-developers] Re: Saving the contents of an array

2010-01-19 Thread schwiz
you could use the xmlSerializer class to write an xml file and sax to read it back in On Jan 19, 9:23 pm, Charlie Collins charlie.coll...@gmail.com wrote: 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