Skip to content Skip to sidebar Skip to footer

Saving Webpage In Cache Using Webview In Android

I am working on an application where I load few websites in webview now I want to save webpages so after sometime even if there is not internet user will able to see those pages. B

Solution 1:

The easiest way is save webpages in cache directory or any other(Internal or external storage)

You can get the data of web page using HttpClient.execute() or HttpClient.get() now store that data in .html file also you have to download images or other contents which are bind to that page, Now in your application you have to check for connection if connection not available then load the page which one you saved in storage with file://<location of your webpage..>

EDIT:

I think using HTML5 you can display off-line webpages. (I never tried this, but I referred some blogs on it). Look at this nice post about HTML5 Creating mobile Web applications with HTML 5, Part 3: Make mobile Web applications work offline with HTML 5 Also this

hope this will help you.

Post a Comment for "Saving Webpage In Cache Using Webview In Android"