Performance: Android Webview vs Views Datasource + parsing JSON

Issue

If a developer is only looking to display specific Views blocks, rather than full webpages, would it seem worthwhile to rebuild the content as XML directly from the output of a Views datasource? Webview seems easier to implement, but I have a feeling it would lead to extra load times and overhead.

Please enlighten me!

Solution

From your answer it is not possible to understand the complexity of your web page that you wish to display, but beware that the usage of WebView may lead to a lot of compatibility issues.

If your webpage is easy to implement natively – I’d recommend going native way. From the performance standpoint it would be the best solution anyway.

If your webpage is complex, check out the Crosswalk project. It’s XWalkView is much more reliable than WebView. Beware, that the downsides of this way would be:

  • Bigger apk size, from my experience not less than +20Mb
  • RAM overhead
  • Extra time on XWalkView instantiation

Answered By – xAF

Leave a Comment