I have to download contents of an HTML file (which uses image) via REST API. Then store them for offline use. When needed I want to display the HTML page with a WebView (of course with image). The REST result should look something like:
{
"id": 45,
"html": "<!DOCTYPE html><html><body><h1>My Heading</h1><p>My paragraph.</p><img src='abc.com/images/54289847.jpg' alt='any' width='104' height='142'></body></html>",
"imagePath": "abc.com/images/54289847.jpg",
"moreData": "something more"
}
So, what will be the most efficient way to do this?
I'm planning encrypted contents of HTML will go to local storage in any file. Same thing for the images. And then decrypt, and load to WebView. But will it work for images?
I don't need any code, just suggest me a way.
in this example string is loaded to webview
String summary = "You scored 192 points."; webview.loadData(summary, "text/html", null);
what if you get string from input stream and pass it to web view IOUtils.toString(context.getResources().openRawResource())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With