Hello,
I don't mean to repost I just didn't get an response to my post in another thread. I'm going to develop a mobile app that loads local html files into a browser object, but am having a hard time getting started. Could anyone share sample code or a stack? I'm new to live code but have been a programmer for years in LAMP systems, so I should catch on fairly well.
Thanks in advance.
Russ
embedding and reading local HTML files in a mobile app
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 7
- Joined: Tue Sep 18, 2012 2:43 pm
embedding and reading local HTML files in a mobile app
Russell McCabe - Lead Developer
"To the man who only has a hammer, every issue he encounters looks like a nail."
http://goodeggclub.com
"To the man who only has a hammer, every issue he encounters looks like a nail."
http://goodeggclub.com
Re: embedding and reading local HTML files in a mobile app
Hi Russ,
all files/folders that you add in the "Copy files" section of the standalone builder can be found here on your device:
-> specialfolderpath("engine")
So the path to your local HTML files will be something like this:
...
put "file://" & specialfolderpath("engine") & "/index.html") into tURL
## or with a subfolder:
## put "file://" & specialfolderpath("engine") & "/mysite/index.html") into tURL
## In case you have SPACES in your filenames, browser don't like that
:
replace SPACE with "%20" in tURL
## Create native browser:
mobileControlCreate "browser"
## Set some props:
mobileControlSet "rect","10,10,600,600"
mobileControlSet "visible","true"
mobileControlSet "backgroundcolor","white"
## And finally load the local html file:
mobileControlSet "url", tURL
...
Check this thread:
http://forums.runrev.com/phpBB2/viewtop ... 49&t=11863
and the "iOS Release Notes" -> "Livecode: Menu: Help" for more info
Best
Klaus
all files/folders that you add in the "Copy files" section of the standalone builder can be found here on your device:
-> specialfolderpath("engine")
So the path to your local HTML files will be something like this:
...
put "file://" & specialfolderpath("engine") & "/index.html") into tURL
## or with a subfolder:
## put "file://" & specialfolderpath("engine") & "/mysite/index.html") into tURL
## In case you have SPACES in your filenames, browser don't like that
![Smile :-)](./images/smilies/icon_smile.gif)
replace SPACE with "%20" in tURL
## Create native browser:
mobileControlCreate "browser"
## Set some props:
mobileControlSet "rect","10,10,600,600"
mobileControlSet "visible","true"
mobileControlSet "backgroundcolor","white"
## And finally load the local html file:
mobileControlSet "url", tURL
...
Check this thread:
http://forums.runrev.com/phpBB2/viewtop ... 49&t=11863
and the "iOS Release Notes" -> "Livecode: Menu: Help" for more info
Best
Klaus
Re: embedding and reading local HTML files in a mobile app
I forgot: Welcome to the forum ![Very Happy :D](./images/smilies/icon_biggrin.gif)
![Very Happy :D](./images/smilies/icon_biggrin.gif)
-
- VIP Livecode Opensource Backer
- Posts: 7
- Joined: Tue Sep 18, 2012 2:43 pm
Re: embedding and reading local HTML files in a mobile app
Thank you Klaus for the info and the welcome. I will give it a shot here later tonight. Being from the PHP world of programming I'm pretty used to naming files with an underscore instead of a space. I'm just trying to get used to the stack and card system and the scripting language. Your example should get me going. I really appreciate it. Russ
Russell McCabe - Lead Developer
"To the man who only has a hammer, every issue he encounters looks like a nail."
http://goodeggclub.com
"To the man who only has a hammer, every issue he encounters looks like a nail."
http://goodeggclub.com
Re: embedding and reading local HTML files in a mobile app
Hi Russ,
check these stacks to get the "grip" of Livecode:
http://www.runrev.com/developers/lesson ... nferences/
Best
Klaus
check these stacks to get the "grip" of Livecode:
http://www.runrev.com/developers/lesson ... nferences/
Best
Klaus