write res/value/string Variables

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

write res/value/string Variables

Postby VIDEN » Fri Jun 12, 2009 8:23 am

Hey,

I've looked for an answer all over the internet but couldn't find anything...
Maybe you can help me...
I was wondering if it is possible to change values of the res/value/string resources or if they are read only?
Reading them with getResources().getString(R.string.mystring) is no Problem but how do I change them?

Greets

David
VIDEN
Developer
Developer
 
Posts: 32
Joined: Tue May 12, 2009 9:39 am
Location: Germany

Top

Postby WarrenFaith » Fri Jun 12, 2009 8:30 am

Why do you want to change them?

I was looking for the same thing a while ago. I want to have some placeholder in my string values to fill it on the fly. I ended up with a string like "you won the game %number% times" and replaced the %number% programmatically.

For usage of multilanguage support, check my short tutorial: Multilingual on droidnova.com
WarrenFaith
Moderator
Moderator
 
Posts: 227
Joined: Fri Mar 13, 2009 10:59 am
Location: Berlin, Germany

Postby VIDEN » Fri Jun 12, 2009 8:40 am

Hey WarrenFaith,

my program will use some sort of network protocol to communicate with a building-automation-station and I wanted to make settings like Host, Port, etc. configurable for the user.
On the first look res/values/ seemed to be a good place to store these settings... but now i think using a PreferneceActivity is the better solution... I looked at the Source of some other Prog (PMix) using the PrefernaceActivity for pretty much the same thing... I just can't find out, where the data is actually stored...

oh and I wanted to use a TabHost for navigating through the program, so the PreferneceActivity should be inside one of the Tabs... is this possible?

greets
VIDEN
Developer
Developer
 
Posts: 32
Joined: Tue May 12, 2009 9:39 am
Location: Germany

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 7 guests