mobileStartTrackingSensor not working anymore?

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
calmrr3
Posts: 100
Joined: Mon Oct 28, 2013 2:39 pm

mobileStartTrackingSensor not working anymore?

Post by calmrr3 » Tue Jan 20, 2015 7:14 pm

Hello,

For some reason my code is no longer working, it doesn't seem to be tracking the location and therefore is not able to do anything on location changed. I wonder if it is an issue with my code? Or could it be in the xcode simulator or the properties?

Heres the Start button script:

Code: Select all

global counterVar
on mouseUp
   put 0 into counterVar
   mobileStartTrackingSensor "location"
end mouseUp
and the card script:

Code: Select all

on locationChanged pLatitude, pLongitude, pAltitude
   
   put pAltitude & cr after field "altitude"
   put pLatitude & cr after field "latitude"
   put pLongitude & cr after field "longitude"
   put counterVar into field "counter"
   add 1 to counterVar
   
   put the short date && the short time into field "dateTest"
end locationChanged  pLatitude, pLongitude, pAltitude
Thanks!
Last edited by calmrr3 on Wed Jan 21, 2015 2:23 pm, edited 2 times in total.

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Contact:

Re: mobileStartTrackingSensor not working anymore? SOLVED

Post by dave.kilroy » Wed Jan 21, 2015 12:17 am

Hi calmrr3 - can you give us information on which versions of OS X, LiveCode and Xcode you are running?
"...this is not the code you are looking for..."

calmrr3
Posts: 100
Joined: Mon Oct 28, 2013 2:39 pm

Re: mobileStartTrackingSensor not working anymore?

Post by calmrr3 » Wed Jan 21, 2015 2:25 pm

OS X Version 10.9.5
Livecode Version 7.0.1
xCode Version 6.1.1

This was working but now it isn't and I can't see any reason why.

Thanks

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

Re: mobileStartTrackingSensor not working anymore?

Post by Simon » Thu Jan 22, 2015 7:35 am

Hi calmrr3,
Yeah, I found something odd with Debug > Location as it wasn't sending out a change until I changed it to another method.

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

scrabbles
Posts: 25
Joined: Sat Dec 20, 2014 4:32 am

Re: mobileStartTrackingSensor not working anymore?

Post by scrabbles » Fri Jan 23, 2015 8:03 pm

I am experiencing this too, preOpenStack or openStack does not seem to start the mobileTrackingSensor. If i put it in the default/first card's preOpenCard or openCard it doesn't work either, however if i put it in another card's preOpen it does work.

Using:
OS X 10.10
xCode 6.1.1
LC 7.0.1 and 7.0.2 (rc1)

iOS 8.1
Android 4.4.2
(both mobile OS not work)

Code: Select all

on initMobile
   if the environment is "mobile" then
      if mobileCanTrackLocation() is true then
         mobileStartTrackingLocation
         //mobileStartTrackingSensor "location", false
      else
         answer "Can't find your location"
      end if
   end if
end initMobile
The above is called from the preOpenXXXX.

ChrisMukrow
Posts: 73
Joined: Mon Nov 12, 2012 4:13 pm

Re: mobileStartTrackingSensor not working anymore?

Post by ChrisMukrow » Fri Jan 23, 2015 8:21 pm

Maybe it's the same problem as in this thread: http://forums.livecode.com/viewtopic.php?f=49&t=22367? If so it got fixed in 6.7.2RC2, see bug report http://quality.runrev.com/show_bug.cgi?id=14290

scrabbles
Posts: 25
Joined: Sat Dec 20, 2014 4:32 am

Re: mobileStartTrackingSensor not working anymore?

Post by scrabbles » Sat Jan 24, 2015 12:27 am

Thanks Chris, you prompted me to double check, I can confirm it is working fine now in both 6.7.2 and 7.0.2. I tested in 6.7.2 with a new clean stack and it worked a treat, but then opening my existing project in 7.0.2 it no longer worked. I shuffled things around in the preOpenStack putting my initMobile call first and moving all variable declares to the top (out of handlers) and it now works ... hmm.

Post Reply