Manually compile the xml layout files and use them

Is it possible to precompile the layout file beforehand, put it in a jar and use it? if possible how?

I will explain: When using apk packaging, the build process pre-compiles xml resources to optimize runtime. Say, for example, I want to download xml files from the server and upload them to ui. I need to precompile them, and I prefer to do this on the server side using android sdk.

+7
source share
1 answer

try the following:

  • put your xml file in your resources folder (e.g. res / xml)
  • run the project
  • go to the bin folder of your project
  • open youapplication.apk file as a zip archive.
  • go to the res / xml folder of your archive.
  • extract already compiled xml from this folder
  • use the extracted XML file as your compliance XML file.
+3
source

All Articles