Gnome dancing victory dance - datagrids and url

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Gnome dancing victory dance - datagrids and url

Post by cusingerBUSCw5N » Mon Jan 21, 2013 11:39 pm

My problem this morning has grown into 3 problems - and it's all on the Android. I blame it on the evil gnome that lives in my LiveCode.

1) I have a datagrid, selected an item from the datagrid, and sent the information over the internet to get a response. It works on laptop and on IOS. But on Android, it fails. I put an answer turl and it shows that it was sending the correct information over the web. But the information it returned was ALL the datagrid that had been loaded on the LiveCode page - information that was never sent over the web - so it isn't reaching the web page. I don't know why it isn't returning a blank - instead it is returning all the data in the datagrid - even if I change the names of the variables. This happened even if the site it was going to was blank! I tested it on two different android devices with the same results.

2) When I was testing another datagrid to see if the same thing was happening, I selected a line in the datagrid, it told me the data for one of the fields "first name" was "John" and I named it tfirstname - but then we I put mobileControlSet "myninthInputField", "text", tfirstname - it was empty.
MobilecontrolSet "myninthInputfield", "backgroundcolor", "pinK" worked just fine.... Setting the textcolor to black didn't solve the problem.

So...I was putting together a sample card with just these issues, and problem #3 came up: put url(turl) into tresponse - which I have used zillions of times before - doesn't work on an Android 4.0.4. It returns a blank. It works on the laptop and on the IOS...but nothing on the Android. I could have sworn that it worked on Android in the past.

I am going to lose my mind.

Here is the code for my sample card:

Code: Select all

on opencard
   put the width of this stack into tstackwidth
   put tstackwidth*.02 into tverticalspace
   put the height of this stack into tstackheight
   set the width of group "datagrid_new" to tstackwidth*.90
   set the height of group "datagrid_new" to tstackheight *.50
  set the left of group "datagrid_new" to tstackwidth*.05
  set the top of group "datagrid_new" to tstackheight*.05
  put "http://www.toolsforbusiness.info/disaster/getmultipleinfo.cfm?tid=19"  into turl

  put url(turl) into ptext

 replace "xyz" with return in ptext
   replace "usetab" with tab in ptext
   --add data
   if ptext is empty then
      answer "Currently there is no Internet access to reach the forum."
       put 1 into tlines
else
   
   put false into firstLineAreNames

   set the dgText[firstLineAreNames] of group "DataGrid_new" to ptext

end if
put empty into field "url"
put empty into field "response"
put empty into field "emaillist"
set the top of field "email_to_send" to the bottom of group "datagrid_new" + tverticalspace
set the top of field "emaillist" to the bottom of field "email_to_send" + tverticalspace
set the top of button "send_email" to the bottom of group "datagrid_new" + tverticalspace
set the top of field "url" to the bottom of field "emaillist" + tverticalspace
set the top of field "response" to the bottom of field "url" + tverticalspace
end opencard
It comes up with no internet connection (blank data) every time. I have internet access on my device - can get other internet sites...can reach it on my laptop and IOS..... :cry:

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: Gnome dancing victory dance - datagrids and url

Post by cusingerBUSCw5N » Tue Jan 22, 2013 2:35 am

I am completely stumped. I have attached my test stack - which on an Android won't connect to the Internet. It works on IOS. It works on my laptop. But it fails on Android... The stack is supposed to load data into a datagrid on open.

Any help would be greatly appreciated.
Attachments
live_code_problems.zip
(7.71 KiB) Downloaded 268 times

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Gnome dancing victory dance - datagrids and url

Post by Simon » Tue Jan 22, 2013 3:31 am

In your test stack:
"internet" isn't checked in the standalone preferences
couple of local vars not declared

Works here in the emulator :D

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: Gnome dancing victory dance - datagrids and url

Post by cusingerBUSCw5N » Tue Jan 22, 2013 5:03 am

oh my gosh! Thank you! I put livecode away for a couple of weeks and forget everything...

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: Gnome dancing victory dance - datagrids and url

Post by cusingerBUSCw5N » Tue Jan 22, 2013 5:19 am

Unfortunately - it still doesn't work (on Android, that is). I've uploaded the replacement stack
Attachments
live_code_problems_new.zip
(7.73 KiB) Downloaded 264 times

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Gnome dancing victory dance - datagrids and url

Post by Simon » Tue Jan 22, 2013 5:39 am

Are you talking about the datagrid?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: Gnome dancing victory dance - datagrids and url

Post by cusingerBUSCw5N » Tue Jan 22, 2013 6:13 am

No - I never even get to the datagrid.... my current problem is that the url(turl) call won't work on an Android (that is what is supposed to load the datagrid - but it comes in empty). It works on IOS and on my laptop. But when I put it on my Android (Ice cream sandwich operating system) - it won't connect - comes back blank.

When I was trying it on my real app, it would just repeat what was in the datagrid - which had nothing to do with the url(turl) call. (I put in two fields to see what what happening - one with the turl - what was being sent out - and one with the response. The one with turl was correct - but the response was just the same data from my datagrid - with information that was neither sent out in turl, nor generated by the file was going to (which I made empty just to test it)....

Someone else on the forum had a similar problem a couple of days ago...but the solution didn't apply to me (http://www.forums.runrev.com/phpBB2/vie ... 53&t=13853) - and was a bit confusing because of language issues. But he couldn't connect to Android using url(turl) either.

I created a test stack to identify the problem - and the test stack won't connect to the internet at all. I don't know why the real app will.... it makes no sense to me. Maybe the real app is using the datagrid info loaded from my laptop - and never really reached the internet either.... I'm not sure. That's why I wanted to create the test stack to identify what was going on.

However, since the test stack won't connect at all - ....I've been stuck ever since. It may work on your simulator, but on my real Android device, it ain't workin'.

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: Gnome dancing victory dance - datagrids and url

Post by cusingerBUSCw5N » Tue Jan 22, 2013 6:22 am

Here's the simplest way I can show the problem

Code: Select all

on mouseUp
   answer "start"
   put "http://www.toolsforbusiness.info/disaster/test.html" into turl
   answer turl
   put url(turl) into twhat
   answer twhat
end mouseUp
Test.html should come up with the word "here". Nothing else is in the file except the word "here". (I also tried it with all the regular html <body> tags - and it failed with that too).

Works on my laptop. Fails on Android. Never goes to answer twhat

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Gnome dancing victory dance - datagrids and url

Post by Simon » Tue Jan 22, 2013 6:29 am

Someone else on the forum had a similar problem a couple of days ago...but the solution didn't apply to me (http://www.forums.runrev.com/phpBB2/vie ... 53&t=13853) - and was a bit confusing because of language issues. But he couldn't connect to Android using url(turl) either.
That had to do with a website that has a mobile site as well... redirects.
Have you tried removing everything but the put url?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: Gnome dancing victory dance - datagrids and url

Post by cusingerBUSCw5N » Tue Jan 22, 2013 6:43 am

that's what I just did. Nothing except

Code: Select all

on mouseUp
   answer "start"
   put "http://www.toolsforbusiness.info/disaster/test.html" into turl
   answer turl
   put url(turl) into twhat
   answer twhat
end mouseUp
on a button.

That's it.... Doesn't work on my Android.

put url(turl) into twhat simply doesn't work.

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: Gnome dancing victory dance - datagrids and url

Post by cusingerBUSCw5N » Tue Jan 22, 2013 6:45 am

launch url("http://www.toolsforbusiness.info/disaster/test.html")

works on my Android....

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: Gnome dancing victory dance - datagrids and url

Post by cusingerBUSCw5N » Tue Jan 22, 2013 6:47 am

But
on mouseUp
answer "start again"
put url("http://www.toolsforbusiness.info/disaster/test.html") into twhat
answer twhat

Doesn't

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Gnome dancing victory dance - datagrids and url

Post by Simon » Tue Jan 22, 2013 7:01 am

Not sure but:
put url("http://www.toolsforbusiness.info/disaster/test.html") into twhat

try:
put url "http://www.toolsforbusiness.info/disaster/test.html" into twhat

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: Gnome dancing victory dance - datagrids and url

Post by cusingerBUSCw5N » Tue Jan 22, 2013 7:13 am

nope...broken (works on laptop, not on Android) :cry:

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: Gnome dancing victory dance - datagrids and url

Post by cusingerBUSCw5N » Tue Jan 22, 2013 7:26 am

get URL "http://www.toolsforbusiness.info/disaster/test.html"
put it into fld "myField"

...also fails

Post Reply