Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android application configuration

Where should I store my Android application's configuration settings?

Coming from the .NET world I was expecting something like a .config file. Do I create a file under res/values, and use that?

like image 764
Justin R. Avatar asked Oct 12 '09 01:10

Justin R.


1 Answers

There is no res/assets. There are assets/ and res/raw/ for arbitrary files, and res/xml/ for arbitrary XML files. However, all of those are packaged as part of the APK and are not modifiable at runtime.

Take a look at SharedPreferences and the PreferenceScreen system for collecting them from users, if these are user-selected configuration settings.

like image 60
CommonsWare Avatar answered Sep 30 '22 02:09

CommonsWare