Skip to content Skip to sidebar Skip to footer

Memory Friendly : View In Xml Or Java Class?

I am starting with development in android apoplications, but not sure about the creation of views. Which one of the two is more preferable in terms of memory-consumption for creati

Solution 1:

There is ultimately Java behind the xml..

so both are same as creating from Java or using xml.

XML help us to customize Views quickly and drag & drop graphically.

The Layout tricks actually works. (For example: Here is an illustration to optimize the memory consumption.)

Solution 2:

If you are just starting with the development and you are new to android..go with XML its easier to understand and experiment with.there are a lot of tutorials around.

Java classes are usually used to set view dynamically..so i would suggest start with XML and move to simple Java tutorials. with memory friendly part(i dint get what you are trying to say) if its about the load time or the CPU usage.its non the less same.

Solution 3:

For the purpose of memory-consumption XML Views are best to use but if you want to make your View Dynamic as you receive data from the Server or from any other resource at run time Then you can use Java for creating those Views.

Post a Comment for "Memory Friendly : View In Xml Or Java Class?"