我尝试使用作为HTML查看器的默认应用程序打开它，但我收到"网页不可用" 系统页面。 浏览器显示的URL是：
How can I open an HTML file I have copied from PC to SD Card of Phone?
I've tried opening it with the default application which is HTML Viewer but I get a "Web page not available" system page. The URL that the browser shows is:
You should be able to point the browser at the file you want with a URL of the format
file:///path/to/file.html. For example, I just did this on my EVO with a file I saved to the root of my SD card as
post.html by launching the browser and entering the URL
Alternatively, my file manager lets me open an HTML file with "HTML Viewer". This is not as feature-rich, though, and didn't seem to render images for me (whereas the browser way loaded everything properly). My file manager does not give me the option to open the file with the browser, or either of the other browsers I have (Firefox and Opera Mobile).
It works in Opera Mobile.
If your file is at
/mnt/sdcard/test/file.html you can access it through the browser from using:
Your file location should not contain any spaces i.e.
/mnt/sdcard/test location/file.html doesn't work, even if the URL replaces it with %20.
Additionally, bookmarking the URL helps!
A few people allude to the issue of having spaces in the file name. I will clarify.
Android is based on Linux, and therefore uses a posix file system. This means that file names with spaces cause issues. Don't use spaces if you are creating a file or directory; leave them out or use periods (
.), dashes (
-), or underscores (
_). To load an existing file with space in it, you must quote the file.
Using the example from the question replace:
If you are otherwise simply opening a file, you may quote the whole string. Like this:
In addition to spaces which can cause problems, posix systems permit characters in file names that are not permitted in Windows. To avoid issues when copying files between systems, even though some are still permitted on Windows as well, do not include the following characters in file names:
/ \ ? * : % " < > | + # '
To avoid further problems use a consistent style of capitalization in file names. Note that posix systems are case sensitive, which means file names are case sensitive. This means that file.txt, FILE.TXT, file.TXT, File.txt, georgE.txt, etc. are all different files on a posix system, while they are considered the same file on Windows.
On my Droid 4 (ICS) from VERIZON I get the browser's address box and type:
Then set it as a bookmark. I use Chrome, not sure if I can set it as a home page like on my PC. This is on my SD card in a folder with lotsa pix.
To hide the pix from cluttering up your gallery, give the directory a period in front of it like
/.my_page/. Use root explorer or a terminal emulator to check the location.
mnt/sdcard/ may point to device internal storage.
Download the Android App from here - Google Play Store - OpenHTML
Just rename the file by appendinh ".html" to it. For example, if the file name is "abcd", rename it to abcd.hmtl. This works for me in android 2.3.