Open an offline html5 page in B4A?

mistermentality

Active Member
Licensed User
Longtime User
I am trying to open a saved (included with the B4A file manager) html5 webpage which includes a simple video tag however if I try loading it into a webview I get a blank white page so I tried to use the PhoneIntents to load it into my default browser which I know supports html5 using this code:


B4X:
Dim p As PhoneIntents
StartActivity(p.OpenBrowser("file:///android_asset/html5.html"))

but it gives me an error about no activity being found to handle the intent, is it possible to get around this in B4A?

I have done some research and it seems the Android webview cannot support html5 so I am not sure if it's even possible to get around this.

The offline page includes a link to an online file. I have had trouble getting many online video files to stream and my intention was to try having a webpage that wraps the video link in a video tag as maybe that would force the appropriate player but unless I can get the page to load I can't try my idea.

Is there a way to open a saved html5 page?

Dave
 

mistermentality

Active Member
Licensed User
Longtime User
Try to copy your file to the sd card and manually create the following intent:
B4X:
    Dim i As Intent
    i.Initialize(i.ACTION_VIEW, "file:///sdcard/file.html")
    i.SetType("text/html")
    StartActivity(i)

Thank you, I did try it but it still shows a white page so I think it just must be impossible to have offline html5 :(

Dave
 
Upvote 0
Top