views:

122

answers:

2

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.

A: 

Hi, 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.

keyboardP
+1  A: 

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.

Eclipsed4utoo
Not user configurable settings. Things like web service namespace, url, etc. or server IPs/domain names.
illvm
Those can be stored there also.
Eclipsed4utoo
you can view this link http://groups.google.com/group/android-developers/browse_thread/thread/091e4be399892329 the next to last response is from Google.
Eclipsed4utoo
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