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. Controlling the shutter of the camera

There are different options to have longer/shorter shutter times in
the camera intent but does anyone know if these could be controlled
Say that I can specify a custom time the shutter should be open?

Thanks in advance!


2. another problem with Galaxy Tab and fullscreen


I'm running our application on galaxy tab. My app draws everything on
a bitmap and displays it on screen. I always use fullscreen by using
the properties:

    <application android:icon="@drawable/icon"
android:label="TotalCross Virtual Machine"
         android:theme="@android:style/Theme.Black.NoTitleBar" >
        <activity android:name=".Loader" android:label="Loading
fontScale|keyboard" />

However, on galaxy tab, even if it correctly detects that the screen
is 600x1024, the bottom pixels of the bitmap becomes strange: it
shows, at the bottom of the screen the top row of the screen twice,
like this picture:

<img src=''>

Seems that it thinks that there's still a taskbar at the top, even if
i set the property like above.

Am I missing something?




3. Get my SIM Phone Number

4. drawing and refreshing small paint over static bitmap

5. Open tablet device? And whatever happened to the TI Blaze tablet?

6. Question regarding RelativeLayout

7. AttributeSet, getAttributeValue method returns null.