1. Are you ready for the Galaxy S20? Here is everything we know so far!

Andriod - local html file

Discussion in 'Computers' started by devcon7, Jul 23, 2013.

  1. devcon7

    devcon7 Lurker
    Thread Starter

    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.
     



    1. Download the Forums for Android™ app!


      Download

       
  2. palmtree5

    palmtree5 Sunny Vacation Supporter!
    Moderator

    Hi there, welcome to the forums!

    Is the page not even displaying at all or is it that the links don't work?
     
  3. devcon7

    devcon7 Lurker
    Thread Starter

    The file does not display

    Thanks
     
  4. palmtree5

    palmtree5 Sunny Vacation Supporter!
    Moderator

    [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. :)
     
  5. devcon7

    devcon7 Lurker
    Thread Starter

    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
     
  6. palmtree5

    palmtree5 Sunny Vacation Supporter!
    Moderator

    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?
     
  7. devcon7

    devcon7 Lurker
    Thread Starter

    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.
     
  8. palmtree5

    palmtree5 Sunny Vacation Supporter!
    Moderator

    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
     
  9. 9to5cynic

    9to5cynic Android Expert

    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.
     
  10. palmtree5

    palmtree5 Sunny Vacation Supporter!
    Moderator

    The local files (specifically various types of media) being linked in the html code is what the issue is here
     
    9to5cynic likes this.
  11. 9to5cynic

    9to5cynic Android Expert

    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?
     
  12. palmtree5

    palmtree5 Sunny Vacation Supporter!
    Moderator

    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
     
  13. 9to5cynic

    9to5cynic Android Expert

    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.
     
  14. devcon7

    devcon7 Lurker
    Thread Starter

    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
     
  15. palmtree5

    palmtree5 Sunny Vacation Supporter!
    Moderator

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

Share This Page

Loading...