Can I launch Android browser within LiveCode Card - Solved
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Can I launch Android browser within LiveCode Card - Solved
I have a need for an android app that I can control the background graphics, while downloading an audio file to the Android Sound Player.
Can I launch the internet browser within a LiveCode Card?
or after a period of time at the website come back to liveCode app?
Thanks,
David
Can I launch the internet browser within a LiveCode Card?
or after a period of time at the website come back to liveCode app?
Thanks,
David
Last edited by DR White on Wed Jun 11, 2014 1:31 am, edited 2 times in total.
-
- Livecode Opensource Backer
- Posts: 447
- Joined: Mon Jan 23, 2012 12:46 pm
Re: Can I launch the internet browser within a LiveCode Card
Check out the androidBrowser object in the dictionary 

Re: Can I launch the internet browser within a LiveCode Card
I tried, but I could not get it to work.
Could you give me an example of how to use it?
Thanks,
David
Could you give me an example of how to use it?
Thanks,
David
-
- Livecode Opensource Backer
- Posts: 447
- Joined: Mon Jan 23, 2012 12:46 pm
Re: Can I launch the internet browser within a LiveCode Card
I'm heading out the door right now, but have a look at this lesson:
http://lessons.runrev.com/m/4069/l/2283 ... er-control
keep in mind that the mobile browser is a native control, so it will not work in the development environment. Also make sure you have internet checked in your standalone settings. I'll be back in a few hours, if you're still having trouble I'll try to help
--Sefro
http://lessons.runrev.com/m/4069/l/2283 ... er-control
keep in mind that the mobile browser is a native control, so it will not work in the development environment. Also make sure you have internet checked in your standalone settings. I'll be back in a few hours, if you're still having trouble I'll try to help

--Sefro
Re: Can I launch the internet browser within a LiveCode Card
That was the perfect simple example, but it will not compile. I shows that it complied successfully, but when I go to the new directory, there is no file!
Can you get the sample stack to run on your machine? I am using Windows 7.
Thanks,
Can you get the sample stack to run on your machine? I am using Windows 7.
Thanks,
-
- Livecode Opensource Backer
- Posts: 447
- Joined: Mon Jan 23, 2012 12:46 pm
Re: Can I launch Android internet browser within LiveCode Ca
I just tried to save the example as a standalone, and the folder was empty here as well. I Tried on a couple different versions of LCcwith the same result......It could be a bug. I'll do few more tests, and see what I can come up with.
-
- Livecode Opensource Backer
- Posts: 447
- Joined: Mon Jan 23, 2012 12:46 pm
Re: Can I launch Android internet browser within LiveCode Ca
I'm Still not sure why the example from the tutorial will not compile into a standalone, but I did a quick test of the mobile browser on android, and it's working as expected.
1. Create a new stack.
2. Drag out a rectangle graphic and resize it to fill the stack
3. Group the rectangle and name the group "browser"
4.Add this code to your card:
5. and this to your stack:
6. Set up your standalone settings for android, make sure "internet" is checked.
7. Test
It seems to be working here Win7 64bit. Hope this helps!
--Sefro
1. Create a new stack.
2. Drag out a rectangle graphic and resize it to fill the stack
3. Group the rectangle and name the group "browser"
4.Add this code to your card:
Code: Select all
on preOpenCard
mobileControlCreate "browser"
put the result into sBrowserId
mobileControlSet sBrowserId, "rect", the rect of group "Browser"
mobileControlSet sBrowserId, "visible", "true"
mobileControlSet sBrowserId, "url", "http://forums.livecode.com"
end preOpenCard
on closeCard
mobileControlDelete sBrowserId
end closeCard
Code: Select all
on preopenstack
set the fullscreenmode of this stack to "exactfit"
end preopenstack
7. Test
It seems to be working here Win7 64bit. Hope this helps!
--Sefro
Re: Can I launch Android internet browser within LiveCode-So
Sefro,
That works GREAT!
I hope I can figure out exactly how it works, so I can create the interface I need.
Thanks SOO Much,
David
That works GREAT!

I hope I can figure out exactly how it works, so I can create the interface I need.
Thanks SOO Much,

David
Re: Can I launch Android internet browser within LiveCode Ca
Could you give me just a little more help?
Now that I can get to the desired website with the LC Android browser, When I click on the mp3 file link at the site nothings happens.
What do I need to do to hear the website audio mp3 file when I select it?
Thanks,
David
Now that I can get to the desired website with the LC Android browser, When I click on the mp3 file link at the site nothings happens.
What do I need to do to hear the website audio mp3 file when I select it?
Thanks,
David
-
- Livecode Opensource Backer
- Posts: 447
- Joined: Mon Jan 23, 2012 12:46 pm
Re: Can I launch Android internet browser within LiveCode Ca
I'm not too sure,I've never tried to get audio from a website with the browser, but if you'd care to share the website that you're trying to display/ play music from I'd be happy to give it a try.
--sefro
--sefro
-
- Livecode Opensource Backer
- Posts: 447
- Joined: Mon Jan 23, 2012 12:46 pm
Re: Can I launch Android internet browser within LiveCode Ca
I tested the website you linked to using the same basic code I posted earlier. I was able to click on a date and have it played in an android player in the emulator. I tried the same exact stack on a physical device, and pressing the link does nothing. I'm not sure why this is, but I will keep messing with it. Anybody else have any ideas?
--Sefro
--Sefro
Re: Can I launch Android internet browser within LiveCode Ca
If it is challenging for you, It would be impossible for me.
Thank You so much for your time and effort,
David
Thank You so much for your time and effort,
David
Re: Can I launch Android internet browser within LiveCode Ca
Hi David,
If you wanted it to stream then skip this posting.
Using Mobile Browser Example.livecode and changing this:
Does work. The files take about a minute to download so you may want to show a clear message.
Simon
Edit: You should probably change that if conditional to:
If you wanted it to stream then skip this posting.
Using Mobile Browser Example.livecode and changing this:
Code: Select all
on browserStartedLoading pUrl
put "Started loading:" && pUrl into field "Status"
if ".mp3" is in pUrl then
put url pUrl into url("binfile:" & specialFolderPath("documents") & "/my.mp3")
put specialFolderPath("documents") & "/my.mp3" into tPath
mobilePlaySoundOnChannel tPath, "current", "now"
end if
end browserStartedLoading
Simon
Edit: You should probably change that if conditional to:
Code: Select all
if char -4 to -1 of pUrl = ".mp3" then
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Can I launch Android internet browser within LiveCode Ca
Simon,
Now that I can get to the desired website with the LC Android browser, When I click on the mp3 file link at the site nothings happens.
I wanted it to play when I clicked on website file linked text, if possible.
Thanks,
David
Now that I can get to the desired website with the LC Android browser, When I click on the mp3 file link at the site nothings happens.
I wanted it to play when I clicked on website file linked text, if possible.
Thanks,
David