I’m looking for a way to cache my html, css and images on Android when only on wifi. If not on wifi the application is to read from the cache. I know a way this can be solved on iPhone ASIHTTPRequest, using Base64 encoding.
So, how to receive a complete html, with images and css files as string, so that I can store it on the phone and display it in offline mode?
EDIT – RESOLVED
- Get the html using
HttpClient - Matching all src and href tags
(src|href)s*=s*\"([^\"]+)\" - Get the file from server and converts it with
Base64 - Replaces the filename tag with the converted Base64 string in the html
- Insert the new html string to a Sqlite database ready for use 🙂
you can use HttpClient class to download html file and other related file and store it.