Ok so the image i\'m using is called test.png and I have a java class (Cherry.java) and a xml class (cherry.xml) Also I have a html file in the /res/raw folder called htmlt
Create this directory assets/www
then place your html and image etc inside the www
folder.
And use the following code.
Cherry.java
webview.loadUrl("file:///android_asset/www/htmltest.html");
htmltest.html
<img border="0" src="../res/drawable-hdpi/test.png" alt="nothing" width="304" height="228" />
Just modify the image path
From:
file:///android_drawable/test.png
To:
file:///android_res/drawable/test.png
If your images are small. Convert them to Base64 codings.
Explained here: http://dean.edwards.name/my/base64-ie.html
First of all welcome to stackoverflow.
Now put your html and image etc inside the Assets folder. And use the following code.
Cherry.java
WebView webview = (WebView) findViewById(R.id.abtus_webView);
webview.loadUrl("file:///android_asset/index.html");
htmltest.html
<img src="images/abc.png">
I have put the images into the images Folder in Assets folder.This is working for me correct,I hope it helps you.