I am looking for a way to cache my html, css and images on Android when only on Wi-Fi. If not in wifi, the application should read from the cache. I know how this can be solved on iPhone ASIHTTPRequest using Base64 encoding.
So, how to get the full html, with images and css files as a string, so that I can store it on my phone and display it offline?
EDIT - SOLVED
- Get html with
HttpClient - Match all src and href tags
(src|href)s*=s*\"([^\"]+)\" - Get the file from the server and convert it using
Base64 - Replaces a file name tag with a converted Base64 string in html
- Insert a new html line into the Sqlite database, ready to use :)