Loading XML layout from server profiles and minuses?

To avoid frequent updates, this is good practice / is it possible to download the XML layout from the server? Thus, any necessary changes can be made to the backend without the need to update the application.

+4
source share
2 answers

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.

+2
source

/ , . ( , ).

, → https://github.com/flipkart-incubator/proteus layoutInflator

, ,

, XML, protus JSON, Android . JSON ( , ..).

0

Source: https://habr.com/ru/post/1691493/


All Articles