• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Simple data

rick99gtp

Newbie
When searching for how to store small pieces of information for my app I run into this a lot, "Unless your application deals only with simple data, you need a database system to store your structured data".

So, how do I handle simple data? With FileInputStream? Where is this hard to find data/data folder?

Anyone have information to share?

Thanks

~Rick
 
Either I don't understand how I would utilize the Preferences you recommended or I didn't explain myself very well. :)

I'd like to store the user's best score in a data file and be able to read it back in and display it on screen when needed. Can I do this with Preferences?
 
Yes you can :-D!
SAVE:
Code:
SharedPreferences.Editor editor = getPreferences(0).edit();
editor.putInt("highScore", 39999);
editor.commit();
RETREIVE:
Code:
SharedPreferences prefs = getPreferences(0); 
 int highscore = prefs.getInt("highScore", -1);
 
Back
Top Bottom