How to design a screen in android?
I am new to Android.
开发者_高级运维I wish to know how to design a screen by using java in Android.
Design via xml and design via java which one is the best?
Design via xml is easier to maintain. For example, if you have to change something in your UI you just change it in one xml file instead of looking for it in all your source code.
On the other side, in java you can do some staff more quickly. Let's say you need to display a matrix of button. In java you can create and display them with a loop instead of creating them via xml.
To sum up, it depends on what you have to do. If you need to design more or less static UIs, opt for xml and use Java only to edit them at runtime.
精彩评论