From docs :
When your application is compiled, it aaptgenerates a class Rthat contains resource IDsall of your resources res/ directory. For each resource type, there is a subclass R(for example, R.drawablefor all resources drawable), and for each resource of this type, there is static integer(for example, R.drawable.icon). This integer is one resource IDthat can be used to retrieve resource.
So the layoutfiles are compiled( in a binary-like format) as part of your project. If you were XMLnot part of your project at build time, you will not be able to use it at time run-time.
This is good practice / is it possible to download the XML layout from the server?
No, due to what I wrote above.
source
share