Reputation: 10971
is it possible to download a whole website content, save it in the App's local data folder, then load the website content in a webview so that the user can view it when offline ?
if so, would you please provide me with sample code or reference for APIs to achieve this
Upvotes: 0
Views: 593
Reputation: 4899
download the entire website as a string
use
string testStr = await (new System.Net.Http.HttpClient()).GetStringAsync("http://www.google.com");
but apart from the html content.
1 - The javascript references and the style sheet , the images all need to have a fully referenced path not relative path .
2 - this can be achieved only in Online mode if we have fully qualified path for the above.
3 - to show the images and javascript you need to have it in local storage or known folder or any other accesible folders like the library and all.
4 - U need to append all javascript to the html in order to do webview.NavigateToString(entire string)
.
5 - So the conceot is a bit too long . Please try following the steps if all resources are available else you wont be able to give it a shot
By resources I mean - Javascript, Images, Css files
Upvotes: 1