简体   繁体   中英

save cache of website in php for offline webview in android

I want to make a simple android application that uses webview for displaying a specific website. Since the app shouldn't open to no connection even in offline mode I want to save the cache first time and show it later. But using myWebView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK); this code only saves simple html files. The website i am using is in php. So it's not working, isn't there any way just the html part of the php page can be saved.

You can download the html to file storage and load it using iframe. If the app is in offline you can take the data from file storage. In this case your css and js have to be inlined to the page.

https://github.com/gregko/WebArchiveReader

How do I save a complete webpage displayed in Android's WebView?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM