mobileControlGet browserid,"url" crashes... ???

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jihem
Posts: 53
Joined: Sun Jul 28, 2013 3:21 pm

mobileControlGet browserid,"url" crashes... ???

Post by jihem » Mon Jun 08, 2015 8:04 pm

Hi,
My app crashes when I try to use mobileControlGet (to get the current URL in the browser).
See the following stack (press GO then URL).
Regards,
jihem
Attachments
mobileBrowserCallBack.zip
(2.14 KiB) Downloaded 187 times

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

Re: mobileControlGet browserid,"url" crashes... ???

Post by MaxV » Tue Jun 09, 2015 1:28 pm

Here are my notes:
  • Please don't use local variables, but custom properties.
  • Why do you think that sBrowserID could not be an integer?
  • Instead of lock screen I'd put all in PreOpenCard message.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

jihem
Posts: 53
Joined: Sun Jul 28, 2013 3:21 pm

Re: mobileControlGet browserid,"url" crashes... ???

Post by jihem » Tue Jun 09, 2015 7:07 pm

Thanks for the answer.

> Please don't use local variables, but custom properties.
sBrowserID isn't a local but a script local.

> Why do you think that sBrowserID could not be an integer?
When the browser can't be created it isn't an integer.

> Instead of lock screen I'd put all in PreOpenCard message.
I have updated the stack as you described with the same result :(
mobileControlGet fails and the app crashes.
Attachments
mobileBrowserCallBack.zip
(2.17 KiB) Downloaded 203 times

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: mobileControlGet browserid,"url" crashes... ???

Post by jacque » Tue Jun 09, 2015 7:36 pm

A script local is appropriate (and recommended) for this type of use, so you've done it correctly. Custom properties are useful for values that need to persist across launches, but they can cause problems if the values are intended to be temporary.

I see nothing wrong with your script or its placement in the message path. I also don't see any reason to move it to a preOpenCard, since the user needs to interact with the Go button before anything happens anyway. I suspect the issue is with the URL itself, since it doesn't really have a source on either the web or on disk; it is entirely virtual. That's just a guess, but everything else in the script is pretty standard stuff.

You may have to check the actual content of the browser text rather than the URL to determine what is being displayed. Try it with a "real" URL, like google.com, and see if you still see the same problem.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jihem
Posts: 53
Joined: Sun Jul 28, 2013 3:21 pm

Re: mobileControlGet browserid,"url" crashes... ???

Post by jihem » Tue Jun 09, 2015 9:16 pm

Thanks. I tried.

I have made the following change in the first version of the stack (on browserStart) :

mobileControlSet sBrowserID,"url","http://www.google.fr"
--mobileControlDo sBrowserID, "load", "", getHTML()

with the same result :-(

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

Re: mobileControlGet browserid,"url" crashes... ???

Post by MaxV » Fri Jun 12, 2015 1:24 pm

I think it's a bug, I tried even loading a normal web page (http://www.google.com) a retrieving the information of the url cause me a crash.
The problem is in:

Code: Select all

mobilecontrolGet( sID, "URL")
I posted the bug here in: http://quality.runrev.com/show_bug.cgi?id=15494
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: mobileControlGet browserid,"url" crashes... ???

Post by jacque » Fri Jun 12, 2015 4:44 pm

They've confirmed it already. Good work, I'm glad you submitted the report.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

seanmiller
Posts: 50
Joined: Mon Mar 03, 2014 1:17 am

Re: mobileControlGet browserid,"url" crashes... ???

Post by seanmiller » Wed Jun 17, 2015 9:59 pm

Howdy,

put mobileControlGet ("lfBrowser", "URL") into tRedirect

also causes iOS to crash...

I've gotten it to crash on an iPad 2 (running iOS 8.2) and on the iOS simulator (device: iPhone 5s).

Sean

seanmiller
Posts: 50
Joined: Mon Mar 03, 2014 1:17 am

Re: mobileControlGet browserid,"url" crashes... ???

Post by seanmiller » Wed Jun 17, 2015 10:11 pm

As we wait, is there some other way to access the URL on a mobile browser?

Post Reply

Return to “Android Deployment”