Tell me more ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

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:

content://com.android.htmlfileprovider/mnt/sdcard/Documents/To%20Read.html?text/html

Any ideas?

Thanks.

share|improve this question
2  
Similar (newer) question that deals with some other filetypes as well: How can I can open local files in the default Android browser? – eldarerathis Apr 15 '11 at 0:06

6 Answers

up vote 11 down vote accepted

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 file:///sdcard/post.html.

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).

share|improve this answer
Excellent, thank you! It seems to work with just file:// (only 2 forward slashes) as well. Also, you are right, it's HTMLViewer software that opens it from the file browser app, not the real browser. Android should give you the option to open HTML files and such using any installed browser, hopefully in the future. – Francisc Jan 16 '11 at 19:09
I am trying the same with opera.It is asking me not able to connect, check network settings. :( – articlestack Sep 23 '11 at 11:13

If your file is at /mnt/sdcard/test/file.html you can access it through the browser from using:

content://com.android.htmlfileprovider/sdcard/test/file.html

Note:

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!

share|improve this answer
Thanks, Nishanth. – Francisc Sep 1 '11 at 9:51

Just type file://localhost/

It works in Opera Mobile.

share|improve this answer

On my Droid 4 (ICS) from VERIZON I get the browser's address box and type:

/mnt/sdcard-ext/my_page/index.html

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.

I think mnt/sdcard/ may point to device internal storage.

share|improve this answer
1  
instead of hiding the directory (naming it .my_page), you can simply put an empty file named .nomedia into the directory -- with the advantage to easier find your directory (as it is not hidden), while still not "cluttering up your gallery". Media scanner skips all directories having this file inside. – Izzy Aug 31 '12 at 11:23

Download the Android App from here - Google Play Store - OpenHTML

share|improve this answer
1  
Can you elaborate a bit? – Al Everett Feb 2 at 16:22

because default HTML viewer is used then no space between the filename e.g "about us.html " is incorrect. rename as "aboutus.html " it will now open

share|improve this answer
1  
This answer already has been given. – Izzy Nov 20 '12 at 19:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.