0

I have a hybrid app I'm working that uses local WebView content as well as native assets. It also includes dynamic updates and user experience customization from a server. I've noticed that the precompiled assets access and load considerably faster than locally stored delivered assets and I get why that is. I am also aware of the general performance issues associated WebView from this topic and this one. We've mitigated this as much as possible. My question is this:

Is there anyway to deliver precompiled assets and add them to the app, or falling that get the device to compile these assets without requiring constant app updates distributed through the play store, which would not work for the user specific content anyway?

EDIT:(Clarification)

When I say native assets, I mean native to the app (precompiled and delivered with the app, as opposed android native assets, or content retrieved from a server which is stored locally and then loaded by the app as opposed during initialization of the app.)

Community
  • 1
  • 1
J-Boss
  • 927
  • 4
  • 14
  • 1
    You could technically compile your XML file off-device using AAPT, push it to the device, use `AssetManager.openXmlResourceParser()` to create an `XmlResourceParser` (instanceof `XmlPullParser`) for it, and finally pass that into `LayoutInflater.inflate()` or `Drawable.createFromXml()`. I don't know of anyone that's actually done it, but it should be possible. The other approach is to make your own layout inflation framework that uses something other than compiled XML. This gets... messy. – alanv Sep 04 '15 at 21:52
  • "as well as native assets" -- please explain, **completely and precisely**, what "native assets" means. – CommonsWare Sep 04 '15 at 22:09
  • @alanv good notes, and interesting approach... I'll give it a try if it works you should post it as an answer – J-Boss Sep 04 '15 at 22:26

0 Answers0