Download Android layout from the web

I would like to ask if there is a way to download android layout from internet to "res / layout" folder.

I was thinking to get the file using HttpUrlConnection and FileOutputStream as Android discussed here for uploading binaries , but I can't guess how to put in the "res / layout" folder.

Thank!

+2


source to share


1 answer


Unfortunately, the layouts in the "res" directory are compressed at build time and include resource IDs that match your previously built R.java. So it would be impossible to take a new layout file at runtime and bloat it in the same way.



However, layouts could be created programmatically (new button (), etc.), so you could probably make an XML and reader format that was very similar to the standard layout format.

+4


source







All Articles