tags:

views:

45

answers:

2

Hi,

I've only just started to write in Java on Android, so please bear with me.

I have some settings I want to hold in my app, normally I would have used an xml file. Trouble is i'm not sure how to load it into the xml parser to read it.

I thought I might be able to drop it into /res/values/Info.xml and open it from there but it does'nt find the file.

I have also read that people are starting to use a SQLite database to hold information in, is this more the standard way to go?

thanks a lot

Luke

+2  A: 

It sounds like what you want are Shared Preferences. Its a simple way of storing key value pairs, along with a UI for letting the user change them.

Mayra
I need to store 200+ items of info, that the user is'nt going to be able to alter. Is the shared prefs still the way to go?
beakersoft
Oh, thats a lot of settings. I think its still possible, if it makes sense for what you are storing to be stored as key-value pairs. A few alternates are discussed in that link though, you can look at the sections on external storage and databases as well.
Mayra
A: 

You could try storing to External Files (that way they can save settings on an SD card if they have 2.2). You wouldn't be able to modify the files in the res folder like you tried because these files get compiled into the app package. You could also try Internal Files found on the same page. SQLite might be a bit much for config settings.

methodin
Thanks for this, I think ill go down the external files route, i think there probably a bit to much info for the shared pref option
beakersoft