Modify strings.xml dynamically

by raukodraug » Thu, 22 Apr 2010 00:55:25 GMT

Sponsored Links
 Hi everyone,

I want to implement a "Settings" section in my application, and I want
that when the user selects whatever, one of the strings from
string.xml will change its value according to the user selection.
Is this possible at all? any ideas on how to implement it?

Have a great day



Modify strings.xml dynamically

by Mark Murphy » Thu, 22 Apr 2010 00:57:05 GMT


You cannot modify strings.xml at runtime. That file, like all resources,
is part of your digitally-signed application.

You are welcome to create your own sort of wrapper mechanism, where you
look to see if the user has changed the value and use it instead of the
string resource, but there is nothing really in Android itself that
implements that pattern for you.

Mark Murphy (a Commons Guy)  | 

Android Training in US: 14-18 June 2010: 


Sponsored Links

Modify strings.xml dynamically

by ~ TreKing » Thu, 22 Apr 2010 01:40:08 GMT

 On Wed, Apr 21, 2010 at 11:55 AM, raukodraug

There's no reason to even try this - this is what the built-in preference
classes are for.

TreKing - Chicago transit tracking app for Android-powered devices 


Modify strings.xml dynamically

by raukodraug » Thu, 22 Apr 2010 04:20:10 GMT

 Thank you Mark and TreKing for your responses, both were very useful.
Now I wont try at all to modify them and the preference activity can
do what i need to
Thanks a lot =)



Other Threads

1. Masked EditText

Some of my input fields are of specific data types.
Therefore, I want to add to my EditText controls implementation of
mask (the mask will control the input limitiations).
Masks for example:
Decimal - N.N (Numeric is not good enought, because it doesn't allow
decimal point).

How can I acheive this?



2. How to pass data between activities?

Hi, all,

I design a small chat application.
Now I have two windows. One window is to edit text and the other is
with the names of the users(checkbox).
I would like to put the users names in a "EditText" in the first
window after we choose the users and click a button "add".
How to do this?
Anyone can tell me?

Thanks in advance!


3. How to retrieve Background Colour

4. can't edit AndroidManifest.xml in eclipse

5. Difficulty writing android manifest file

6. How to get movie's times?

7. Android porting to other platforms