Displaying Web Pages

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Gene
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 75
Joined: Wed Mar 09, 2011 6:48 pm
Location: Northern California

Displaying Web Pages

Post by Gene » Mon Feb 27, 2012 11:58 pm

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

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Displaying Web Pages

Post by Mark » Tue Feb 28, 2012 12:26 am

Hi Gene,

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"
This opens the website in the Android browser.

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

Gene
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 75
Joined: Wed Mar 09, 2011 6:48 pm
Location: Northern California

Re: Displaying Web Pages

Post by Gene » Tue Feb 28, 2012 5:38 am

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

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: Displaying Web Pages

Post by Jellicle » Tue Feb 28, 2012 5:53 am

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
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Gene
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 75
Joined: Wed Mar 09, 2011 6:48 pm
Location: Northern California

Re: Displaying Web Pages

Post by Gene » Tue Feb 28, 2012 5:44 pm

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
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.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Displaying Web Pages

Post by BarrySumpter » Sun Mar 04, 2012 5:06 am

Hi Gene,

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.

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: Displaying Web Pages

Post by Jellicle » Sun Mar 04, 2012 5:27 am

BarrySumpter wrote:I'd be very interested in knowing how to retrieve GPS info on android.
Check the Android release notes, page 20. After starting tracking with mobileStartTrackingLocation you call mobileCurrentLocation().

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Displaying Web Pages

Post by BarrySumpter » Sun Mar 04, 2012 5:32 am

Jellicle wrote:
BarrySumpter wrote:I'd be very interested in knowing how to retrieve GPS info on android.
Check the Android release notes, page 20. After starting tracking with mobileStartTrackingLocation you call mobileCurrentLocation().

Gerry
Hi 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.

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: Displaying Web Pages

Post by Jellicle » Sun Mar 04, 2012 8:09 am

Whoops. I didn't realise I had a pre-release version open when I checked that *blush*.

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Displaying Web Pages

Post by BarrySumpter » Sun Mar 04, 2012 8:13 am

No Prob.
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.

Simon Knight
Posts: 845
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Displaying Web Pages

Post by Simon Knight » Tue Mar 06, 2012 9:20 am

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
best wishes
Skids

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Displaying Web Pages

Post by BarrySumpter » Tue Mar 06, 2012 10:46 am

1 map refresh every 1.44 mins.
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.

Simon Knight
Posts: 845
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Displaying Web Pages

Post by Simon Knight » Tue Mar 06, 2012 11:00 am

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
best wishes
Skids

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Displaying Web Pages

Post by BarrySumpter » Tue Mar 06, 2012 1:39 pm

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.

Post Reply

Return to “Android Deployment”