Displaying Web Pages
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 75
- Joined: Wed Mar 09, 2011 6:48 pm
- Location: Northern California
Displaying Web Pages
I made a rash assumption (again) that LC for Android can display web pages. It appears that this is normally done with RevBrowser, which is not available for Android yet. One post referred to do this by "linking" to the user's native browser and passing the URL to that, which I don't don't know how to do. Is anybody displaying web pages in their Android apps, and how so?
Thanks much - Gene
Thanks much - Gene
Re: Displaying Web Pages
Hi Gene,
The only way to display an internet page on Android is by using the launch command:
This opens the website in the Android browser.
Kind regards,
Mark
The only way to display an internet page on Android is by using the launch command:
Code: Select all
launch URL "http://www.android.com"
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- VIP Livecode Opensource Backer
- Posts: 75
- Joined: Wed Mar 09, 2011 6:48 pm
- Location: Northern California
Re: Displaying Web Pages
Thank you Mark!! I don't know how I missed the launch command, because I thought I scoured the docs and the forums pretty thoroughly. Must be getting blind, I guess.
Not only does the launch URL bring up web pages from LC Android just fine, but I also dug dug up what Google calls "Static Maps API," All you have to do is launch the base URL with parameters of your choice (that are supplied in an example), and you have a map with a pin in it displayed in your browser. Now, two of the parameters (surprise) are the latitude and longitude of the pin, so then you just convert your current position Lat/Lon from the GPS to a couple of variables, insert them in the string, and now you have an on demand current position location map in your app!
Displaying the map in the browser from the app works just fine with a predefined string of parameters. Tomorrow I'll create a test program to insert the real time GPS output as variables into the string to send to the maps URL to make sure that works, but that's pretty basic.
The next holy grail is a moving map that tracks real-time movement. Google offers other API's that look like they serve this function, but I'm pretty sure they require at least the ability use java to communicate the Lat/Lon and other variables to the moving map. My sense is that it can be done with LC, but I think there is a learning curve associated with that step.
Thanks again, Gene
Not only does the launch URL bring up web pages from LC Android just fine, but I also dug dug up what Google calls "Static Maps API," All you have to do is launch the base URL with parameters of your choice (that are supplied in an example), and you have a map with a pin in it displayed in your browser. Now, two of the parameters (surprise) are the latitude and longitude of the pin, so then you just convert your current position Lat/Lon from the GPS to a couple of variables, insert them in the string, and now you have an on demand current position location map in your app!
Displaying the map in the browser from the app works just fine with a predefined string of parameters. Tomorrow I'll create a test program to insert the real time GPS output as variables into the string to send to the maps URL to make sure that works, but that's pretty basic.
The next holy grail is a moving map that tracks real-time movement. Google offers other API's that look like they serve this function, but I'm pretty sure they require at least the ability use java to communicate the Lat/Lon and other variables to the moving map. My sense is that it can be done with LC, but I think there is a learning curve associated with that step.
Thanks again, Gene
Re: Displaying Web Pages
I wouldn't be surprised if LC adds native browser controls for Android at some point - currently the platform lags way behind iOS in regards to native controls.
And on iOS at least you can already use all the Google Maps API Java stuff...I haven't done live updating of location but I've done pretty much everything else, and it works fine...if a bit slow.
Gerry
And on iOS at least you can already use all the Google Maps API Java stuff...I haven't done live updating of location but I've done pretty much everything else, and it works fine...if a bit slow.
Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
-
- VIP Livecode Opensource Backer
- Posts: 75
- Joined: Wed Mar 09, 2011 6:48 pm
- Location: Northern California
Re: Displaying Web Pages
There is a note in the latest release notes for Android that says that a future release will have "a substitute mechanicsm" for RevBrowser. I would suppose that whatever functionality the substitue mechanism has, the coding will correspond to RevBrowser for iOS, or you would have to code differently for each platform. In that case, LIveCode would not be cross platfrom for Anbdroid and iOS with regard to browswer control.Jellicle wrote:I wouldn't be surprised if LC adds native browser controls for Android at some point - currently the platform lags way behind iOS in regards to native controls.
And on iOS at least you can already use all the Google Maps API Java stuff...I haven't done live updating of location but I've done pretty much everything else, and it works fine...if a bit slow.
Gerry
-
- Posts: 1201
- Joined: Sun Apr 24, 2011 2:17 am
Re: Displaying Web Pages
Hi Gene,
I'd be very interested in knowing how to retrieve GPS info on android.
tia
I'd be very interested in knowing how to retrieve GPS info on android.
tia
All my best,
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Re: Displaying Web Pages
Check the Android release notes, page 20. After starting tracking with mobileStartTrackingLocation you call mobileCurrentLocation().BarrySumpter wrote:I'd be very interested in knowing how to retrieve GPS info on android.
Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
-
- Posts: 1201
- Joined: Sun Apr 24, 2011 2:17 am
Re: Displaying Web Pages
Hi Gerry,Jellicle wrote:Check the Android release notes, page 20. After starting tracking with mobileStartTrackingLocation you call mobileCurrentLocation().BarrySumpter wrote:I'd be very interested in knowing how to retrieve GPS info on android.
Gerry
Many thanks.
What Version of LC and/or android deployment pack?
All my best,
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Re: Displaying Web Pages
Whoops. I didn't realise I had a pre-release version open when I checked that *blush*.
Gerry
Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
-
- Posts: 1201
- Joined: Sun Apr 24, 2011 2:17 am
Re: Displaying Web Pages
No Prob.
Just checking.
Just checking.
All my best,
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
-
- Posts: 845
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: Displaying Web Pages
Hi,
Did you realise that you may display a google static map inside a LC app on android (or any where else) by using a standard LC image well. Just set the file parameter to the google static maps URL and the image will display the map. Google imposes some limits on its free service - max size is 640 by 640 and no more than 1000 map images in 24 hours. Within these limits its possible to create a quasi moving map by updating the image every so often.
Simon
Did you realise that you may display a google static map inside a LC app on android (or any where else) by using a standard LC image well. Just set the file parameter to the google static maps URL and the image will display the map. Google imposes some limits on its free service - max size is 640 by 640 and no more than 1000 map images in 24 hours. Within these limits its possible to create a quasi moving map by updating the image every so often.
Simon
best wishes
Skids
Skids
-
- Posts: 1201
- Joined: Sun Apr 24, 2011 2:17 am
Re: Displaying Web Pages
1 map refresh every 1.44 mins.
calcs like plenty.
calcs like plenty.
All my best,
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
-
- Posts: 845
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: Displaying Web Pages
1000 maps per day and 1440 mins per day = 1 map every 1.4 mins.
but
"calcs like plenty"
My Andriod app refuses to display the google image that indicates you have used to many maps - its fine on desktop though - odd.
Simon
but
"calcs like plenty"
My Andriod app refuses to display the google image that indicates you have used to many maps - its fine on desktop though - odd.
Simon
best wishes
Skids
Skids
-
- Posts: 1201
- Joined: Sun Apr 24, 2011 2:17 am
Re: Displaying Web Pages
Maybe trap the message and display your own graphic?
All my best,
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.