From Newsgroup: comp.mobile.android
Andy Burns wrote:
I don't know much about ipads, but on android you can't open file://
URLs directly, you used to be able to convert them to content:// URLs,
but last time I tried doing that, it no longer worked and required a
web server on the tablet to serve the html files
I think this is the version of apache that I used a couple of years ago <https://play.google.com/store/apps/details?id=com.sylkat.apache&hl=en_GB>
This turns out to be an extremely complex subject, so the easiest way to approach the solution is to use empirical evidence since it's complicated.
The problem on Android that Andy is speaking about is when the deep HTML hierarchy has relative paths, which is treated differently in Android 11+
but only when using some file browsers and only in some HTML viewers.
For example, Firefox tends to allow file:/// access while Chrome does not,
and, there's the added quirk that when some folder managers such as FV
Folder Explorer access HTML files they add content:/// URIs such as content://com.folderv.file.fileprovider/.../pages/index.html
which invariably fails with a (net::ERR_FILE_NOT_FOUND) error
while other folder managers such as MiXplorer do not add that crap.
On the other hand, iOS has file managers such as "Files", "Documents by Readdle" or "Total Files", which, in general, see only inside their
protected storage, while, in general, Android file managers have read
access to the user file system.
Given that, my recommendation, based on empirical tests alone, is on
Android to use a FOSS file manager such as MiXplorer which not only
maintains proper local context and bypasses restrictive single-file content wrappers, but it allows browsers and internal HTML viewers to successfully resolve sibling directories, embedded CSS and deeply nested sub-pages (such
as /storage/emulated/0/shop/manual/index.html/page1.html) wholly offline.
On iOS, my recommendation would be to download the zip file and use the "Documents by Readdle" built-in file browser and local web view engine that allows cross-referencing of HTML files and assets locally without needing
an active internet connection or a local web server. Documents by Readdle
on iOS can tap the root index.html or table of contents page, and it will navigate through the deeply nested subfolders natively.
In summary, it can be done on both iOS and Android but you have to find the right file explorer and HTML viewer to be successful at viewing deeply
nested relative-path HTML content locally.
--
Every working example is someone paying forward a hard-learned lesson.
--- Synchronet 3.22a-Linux NewsLink 1.2