• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Andriod - local html file

devcon7

Lurker
Hi,

We have an Andriod tablet. We are trying to access a simple html file via the local usb drive. The html file has links to local video files on the usb. Is there any special code that needs to be written to render the html page. Our current page is accessible via a local pc, but we get an error message on the android.

Any help or sample code would be appreciated.
 
Hi there, welcome to the forums!

Is the page not even displaying at all or is it that the links don't work?
 
[HIGH]<HTML>
<HEAD>
<TITLE>
A Small Hello
</TITLE>
</HEAD>
<BODY>
<H1>Hi</H1>
<P>This is very minimal "hello world" HTML document.</P>
</BODY>
</HTML>[/HIGH]
Try making a file called "hello.html" with the above code and attempt to open it on the tablet please. :)
 
Hi,

Did the above, get the below message..

Webpage not available.

The webpage at file:///mnt/ext_usb1/hello.html might be temporarily down or it may have moved permanently to a a new web address
 
Try using a file explorer to open the html document

On a side note, are you sure the USB drive is connected? Can you open other files on it?

Also, what is the format of the filesystem on the USB drive?
 
Hi,
I tried File Explorer and clicked on the "Hello.html" it then prompted me to which program I wanted to use. I used HTML Viewer and the page opened. Cool

I then modified it to add a link to a video on the usb drive (see below) the link did not work, however if I paste the link into the browser, the video plays fine.

<HTML>
<HEAD>
<TITLE>
A Small Hello
</TITLE>
</HEAD>
<BODY>
<H1>Hi</H1>
<P>This is very minimal "hello world" HTML document.</P>
<a href="file:///mnt/ext_usb1/MyVideo.mp4">Link to Video</a>
</BODY>
</HTML>

This project is a bit urgent and I am happy to pay you for your time. I will send you my contact info via a private message if you are interested

Thanks in advance for your help.
 
Hi,
I tried File Explorer and clicked on the "Hello.html" it then prompted me to which program I wanted to use. I used HTML Viewer and the page opened. Cool

I then modified it to add a link to a video on the usb drive (see below) the link did not work, however if I paste the link into the browser, the video plays fine.

<HTML>
<HEAD>
<TITLE>
A Small Hello
</TITLE>
</HEAD>
<BODY>
<H1>Hi</H1>
<P>This is very minimal "hello world" HTML document.</P>
<a href="file:///mnt/ext_usb1/MyVideo.mp4">Link to Video</a>
</BODY>
</HTML>

This project is a bit urgent and I am happy to pay you for your time. I will send you my contact info via a private message if you are interested

Thanks in advance for your help.

Doesn't work for me either when using HTML viewer but it works for me if I open it in a browser (in my case Firefox Beta)

EDIT: works on Chrome for Android too
 
I've also been able to open local .html files by using the standard file:///sdcard/dir/whatthe.html

Not sure why it wouldn't be working for you.
 
I've also been able to open local .html files by using the standard file:///sdcard/dir/whatthe.html

Not sure why it wouldn't be working for you.

The local files (specifically various types of media) being linked in the html code is what the issue is here
 
Hmm... I don't have a video to test it with, but it works for me with images.

in maxathon on my old evo I went to file:///sdcard/test.html which had a single image tag of
<img src=1.jpg />

I don't know, maybe it is only video?
 
Mine is
[HIGH]<a href="file:///sdcard/media/audio/notifications/facebook_ringtone_pop.m4a">test</a>[/HIGH]
and works if I open with an actual web browser [NOT HTMLViewer (/system/app/htmlviewer.apk)]

EDIT: That's an audio file
 
Hmm... well, I'm stumped, but it's been one of those days :rofl: ;)

maybe it's the relative vs. absolute paths?

edit: mine worked with htmlviewer, but again, it's only an image.
 
Hi,

Tried Chrome and Firefox - No luck

The device we are using is a Viewsonic VSD220

Any other suggestions (or workarounds) on how to get the video links to work off the local webpage ?

Thanks
 
Do you have an application installed that will play .mp4 files? That could be the issue because there's nothing wrong with the HTML code AFAICT
 
Back
Top Bottom