browser widget to view local html file

The place to discuss anything and everything about running your LiveCode on Android

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
malee
Posts: 1
Joined: Sun Jul 17, 2016 10:02 pm

browser widget to view local html file

Post by malee » Mon Jul 18, 2016 1:33 pm

i tried to get the new browser widget to view local html file on android but failed , it works on window desktop . i searched this forum and found someone with similar issue but couldn't get it solved, upload the a zip stack

here is the code for the on opencard

Code: Select all

set the URL of widget "MyBrowser" to ("file://" & specialFolderPath("resources") & "/info.html")
Attachments
BrowserWidgetTest.zip
(2.07 KiB) Downloaded 151 times

MaxV
Posts: 1577
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: browser widget to view local html file

Post by MaxV » Tue Jul 26, 2016 5:05 pm

for local files use the htmlText property like this:

Code: Select all

put URL ("file://" & specialFolderPath("resources") & "/info.html") into temp
set the htmlText of of widget "MyBrowser" to temp
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

bogs
Posts: 5096
Joined: Sat Feb 25, 2017 10:45 pm

Re: browser widget to view local html file

Post by bogs » Sun Jan 24, 2021 12:17 pm

I realize this is a 4 year old post, but it was the top search result for what I recently was looking up, so I am going to add an answer to what I think was wrong here.
malee wrote:
Mon Jul 18, 2016 1:33 pm
i tried to get the new browser widget to view local html file on android but failed , it works on window desktop . i searched this forum and found someone with similar issue but couldn't get it solved, upload the a zip stack

here is the code for the on opencard

set the URL of widget "MyBrowser" to ("file://" & specialFolderPath("resources") & "/info.html")
As far as I know (but I could be VERY wrong), you don't put forward slashes preceeding specialFolderPath statements, and, even if you did, you would not use 2 of them as a single slash indicates the root level of the file system.

Changing the above code to read -

Code: Select all

set the URL of widget "Browser" to "file:" & specialFolderPath("resources") & "/info.html")
I am pretty sure would fix the issue.
Image

Post Reply

Return to “Android Deployment”