tags:

views:

61

answers:

3

Hi I have a small doubt Which is the best way to design UI for Android Coding or Desinging in XML?

Which is better in performance?

+3  A: 

Performance will be similar (the XML version will be a little bit slower to load but not noticeably.) But by using XML you get automatic support of runtime configuration changes. You can easily provide different layouts for different resolutions, orientations, languages, etc. It is recommended to use XML to define your UIs as much as possible.

Romain Guy
+2  A: 

From personal experience I would say that the performance difference between the two is negligible. However, use XML for the pure reason that it it more maintainable. This way you can create your layouts in a way that can be easily recognized and edit by other possible future developers (or even yourself later).

Anything you can do layout wise in code you can do in XML and if you need to add more advanced features you can still reference elements in the XML in code using findViewById(R.id.ELEMENT_NAME);

BeRecursive
A: 

First of all i would say its a very good question and i will say that its XML which will be easier to use rather than code.because

1> Designing layout using xml give u a better look and feel for the application 2> If u want to make application which is has property of seamlessness then also XML is the best way 3> It is much quicker and faster to design UI woth XML than code..

This is what i think...

Thanks Rakesh

Rakesh Gondaliya