1

Q: Is this possible to save html page with images, css, and other resources in android?

I know it's possible to save page archive in webView, however I need to store page without viewing it in background (i was trying call saveWebArchive in asynctask and get RuntimeException: Can't create handler inside thread that has not called Looper.prepare()).

I was thinking about downloading page by DefaultHttpClient, then parsing html resources urls, downloading images, etc. and then replace urls in html by downloaded resources paths, but in seems very complicated for me.

orium
  • 3,743
  • 2
  • 24
  • 27
  • What are you trying to achieve, I'm having a hard time figuring out your requirements. Do you want to 'cache' a page, for viewing later? Do you want to scrape the page for just content? Looper.prepare() and Looper.loop() around where it's complaining will solve your exception, but aside from that, I can't help further without more information. – laminatefish Jul 18 '14 at 15:15
  • I think you should have an invisible fragment with the WebView for loading the page. Afterwards, you can save the page as web archive with instructions described in this post - http://stackoverflow.com/questions/12872043/android-webview-display-webarchive – Gavin Jul 18 '14 at 15:28
  • I want save page from url, for next viewing it offline. – orium Jul 18 '14 at 17:35

0 Answers0