I have Web Application runs in Android. I can cache my web, so if user has not internet connection, he can still access web from cache. But it only run when user has not Internet Connection.
Now, for optimzing my apps, when user has internet connection, I want to cache all image that show in WebView
And store it locally/cache it, and when user open a page with same src image that I have cached it, it load from local, not load it from web again. Or May be not image, but html
page that visited cache it, and when user back to url page again, Webview
load it from local, not from internet.
I have search the code for two days but still no finding solution.
Thanks for help.
Try this
and then
}
and the method
isNetworkAvailable()
checks for an active network connection:Finally, don't forget to add the following three permissions to your
AndroidManifest.xml
: