Take the 2-minute tour ×

Is there an Android equivalent of .NET's application.config? I am currently using a values XML file for a similar effect, but this doesn't seem to be the right approach. I looked into using SharedPreferences, but I need to access some settings outside of activities.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Are you taking about configurable settings? If so, the SharedPreferences is what you want. If I am not mistaken, the SharedPreferences are not for a specific Activity, it's for your entire application(widget, activity, service, etc.), or at least it can be. If you use the same file name in all parts of your application, then it will be.

share|improve this answer
Not user configurable settings. Things like web service namespace, url, etc. or server IPs/domain names. –  illvm Dec 28 '09 at 19:40
Those can be stored there also. –  Eclipsed4utoo Dec 28 '09 at 20:19
you can view this link groups.google.com/group/android-developers/browse_thread/thread/… the next to last response is from Google. –  Eclipsed4utoo Dec 28 '09 at 20:26
What I was kind of hoping for was to be able to have access to things like this from classes outside of Activities or Services but it seems that I'd have to pass in the application context to use this, which makes sense. Thanks. –  illvm Dec 29 '09 at 18:23

The AndroidManifest.xml file may be of use. I'm quite new to Android development, but from tutorials and documentation, I find that the use of XML Values and such are quite commonplace. However, for application bindings and details, the AndroidManifest file is key.

share|improve this answer

Your Answer


