1

im a new android developer.
My app has WebView which loads lot of data from my site (which has pics, css, JS files).only the html code is updated weekly. other files are almost never changed. so i was thinking of including these static files in android assets, loading only the html from server and other files from assets and cutting down the loading time. how do i do it.
Android WebView Javascript from assets
and as shown in the above solution i cant change the html code to load these from assets because this site will also be accessed by web users.
Is there a way to do this. Thanks in advance..

Sam
  • 105
  • 2
  • 14

1 Answers1

0

Firstly you need to have relative paths

 <img src="images/someimage.png">

not

<img src="www.mysite.com/images/someimage.png">

Then you need to load the HTML code not using webBrowser, for example like here And then you can load HTML source into WebBrowser using base URL pointing to your assets like here

Community
  • 1
  • 1
Vladyslav Matviienko
  • 10,610
  • 4
  • 33
  • 52