technically, when you browse online, the text, the images and the css styling are
all downloaded to memory. if you turn off the internet, the page is still in memory.
it is possible to find it and browse it from memory (the cache) with a webview, but
it is not easy to find. it has been mentioned here in the forum some time ago.
locating the cache and knowing how to use it will require some research (actually,
a lot of work, i think.)
if the page is mostly text (like a page from a book), an easier solution might be
to download the page with okhttputils2 and save it. you can then load it into a
webview. although this is easier, the problem is that webpages are not usually kept
entirely in 1 file. there are css files, javascript files and actions which require
downloading data (eg, clicking on links). since you will be offline, none of that
will be possible. the most you will get is 1 html file. what is in that file is
difficult to say; you will not know until you try. here's an example:
i assume you are familiar with okhttputils for downloading from the internet.
download the page you want to browse.
ONLINE
j.download("https://www.b4x.com")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
File.WriteString(File.DirInternal,"b4x.html", j.GetString)
j.Release
else
....
end if
NOW OFFLINE
Dim webview1 As WebView
webview1.Initialize("wv")
Activity.AddView(webview1,0%x,0%y,100%x,100%y)
webview1.LoadHtml(File.ReadString(File.DirInternal,"b4x.html"))
i downloaded the b4x homepage and saved it in dir.internal. now i open a webview
and load the file offline. see 2 screen captures below. #1 looks normal. #2 has a problem.
there are supposed to be images visible. but that means downloading them. i'm offline,
so i can't download them. what i can see is all the text that appears on the home
page. if that's enough for you, then you can browse offline. i can easily browse all the
text offline, but clearly there are limits.