in Android

Android XML Code format

It’s been a while since I last posted something about android programming.
From my point of view, this is a great thing, there is an untold story lying here! :)

Working with the Android UI requires a lot of XML “syntaxing”. (I’m sorry, I do not like the use of the words “programming” or “develpment” for XML).
Eclipse was a beautiful feature, called “Code formatter” where you press Ctrl + Shift + F (Format) and it nicely formats your code.
It works like a charm as long as the code is Java. When the code is XML, it does tide the code, but it is still non easily readable.

example of formatted but not well readable XML code:

Fortunately, there is a way for the eclipse code formatter to tide the XML code even more and make it way more readable.
Just go to Preferences -> XML -> XML Files -> Editor and check the “Split multiple attributes each on a new line”.

Now you have this:

enjoy! =)

Share