Jump to Navigation

Me on Twitter

  • @Eyal_Lezmy pas seulement l'équipe mais potentiellement tte la communauté. Question d'intérêt public en qq sorte ;-) 12 years 5 weeks ago
  • @ParisAndroidUG Quel est le moyen privilégié de poser une question android au #PAUG ? J'ai beau chercher... pas de forum-like sur paug.fr... 12 years 5 weeks ago
  • @malsini documentation is (c) by @agoncal. I suggest u have a look at his book... Also we talked about articles at http://t.co/NZE3z6zG 12 years 6 weeks ago
  • A voir absolument : Animez vos pages HTML5, Martin Gorner, Google (Atelier Open Data Google / Dataconnexions) http://t.co/6quwgLu6 12 years 6 weeks ago
  • Yesterday ended a great 3-day Java EE 6 training course by @agoncal with @alexlewando and others. Group agrees on the quality of the class ! 12 years 6 weeks ago
  • @romainguy @ParisAndroidUG Retour d'expérience depuis les débuts d'android, qu'est-ce qui marche et ne marche pas ? Le futur d'android ? 12 years 6 weeks ago
  • #NegativeSpace A bit hard to use but a very ingenious puzzle game for #android that deserves a try http://t.co/71GvLfmV 12 years 7 weeks ago
  • @louistouzet Bravo pour cette belle appli qui monte, qui monte ! #AngryBirds https://t.co/i5ppeyvr http://t.co/3xBnMBBs 12 years 8 weeks ago
  • 2 dev java/android cherchent équipe / projet #dataconnexions 12 years 9 weeks ago
  • @Lim_Ace too bad it doesn't display correctly on my #android... Can't read anything 12 years 9 weeks ago

XML resources

android How to organise XML resources

The first time I read Android developer docs, there was something that was unclear to me : what resource to put in which XML file.

In this article, I will focus on resources in res/values and give some hints about how to name your XML resource files and what kind of resource to put inside.

...

In my case I had only one or two arrays of strings so it was overwhelming to put them in a separate file just because they were of a different type.

Another problem was accessing constant values from both XML layout and Java code. They are constant strings for internal use only, but in order to avoid duplicate declarations I decided to make them available as XML resources. I wanted those resources to be clearly separated from other, 'user visible', resources like GUI labels.

Another thing adding to the fog was the fact that, in derivate files (e.g. strings-fr.xml is derivated from strings.xml), you only want to find values relevant for the given file.
For instance, if you put all values of type 'string' in the same file but only a part of them should be internationalized, you would have a gap between the original and derivated files not only by the translated values but also by the list of values they declare. When coming back to the project after a long time, you might have a hard time remembering why there is this gap.

...

Syndicate content