GPS Questions...

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
paulsr
Posts: 222
Joined: Thu Jul 19, 2012 9:47 am
Contact:

GPS Questions...

Post by paulsr » Tue Oct 23, 2012 7:41 am

Folks; a couple of GPS questions for you:

1) A number of apps seems to be able to determine and indicate the strength of the GPS signal, but I don't see any Livecode keyword that would enable this.

For instance, I was out walking one morning, while using a walk monitor app, when I realized there was a woman in my back pocket complaining that the GPS signal strength was low! How did she know this?

I notice that mobileSensorReading ("location", true) will return a parameter called "horizontal accuracy." Is that how I would determine signal strength?

2) If I have started location tracking, I can monitor the current location by using on locationChanged.

But I notice one Livecode lesson says "You can request sensor information directly, without having to process the changed messages."

Is there any reason or benefit to using 'get mobileSensorReading' at regular intervals, rather than waiting for locationChanged messages?

Many thanks...

--paul

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm

Re: GPS Questions...

Post by gpb01 » Tue Oct 23, 2012 9:02 am

Hi Paul,
AFAIK, on iOS you can't have the GPS signal strength. CLLocation object, from CoreLocation.framework, contains the following properies:

- altitude – type CLLocationDistance
- coordinate – type CLLocationCoordinate2D
- course – type CLLocationDirection
- horizontalAccuracy – type CLLocationAccuracy
- speed – type CLLocationSpeed
- timestamp – type NSDate
- verticalAccuracy – type CLLocationAccuracy

and, if you look in CLLocation.h you understand the type of data :

Code: Select all

typedef double CLLocationAccuracy;
typedef double CLLocationSpeed;
typedef double CLLocationDirection;
typedef double CLLocationDistance;
typedef double CLLocationDegrees;
typedef struct {
	CLLocationDegrees latitude;
	CLLocationDegrees longitude;
} CLLocationCoordinate2D;
... as you can see ... the are some value that are missed in LiveCode (e.g. speed), but, anyway, ... there is NOT any info about signal strength :(

Obviously, you can use the accuracy to have an indication of the goodness of the signal that you are receiving, but ... it is an empirical method ;)


Regarding your second question ...
... personally I prefer to use 'get mobileSensorReading' to have a 'deterministic' interval time in which I acquire the position, but ... is really dependent on the type of application you have to develop :)

Guglielmo

paulsr
Posts: 222
Joined: Thu Jul 19, 2012 9:47 am
Contact:

Re: GPS Questions...

Post by paulsr » Tue Oct 23, 2012 9:47 am

Many thanks Guglielmo ... very helpful.

--paul

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm

Re: GPS Questions...

Post by gpb01 » Tue Oct 23, 2012 10:38 am

Paul,

if you really need of an accurate GPS to connect to your iOS device and precise GPS info software, I can suggest this product : http://proviationshop.co.uk/shop/articl ... PS150-E%26 with this free App : https://itunes.apple.com/us/app/bluetoo ... 61436?mt=8 ;)

Guglielmo

paulsr
Posts: 222
Joined: Thu Jul 19, 2012 9:47 am
Contact:

Re: GPS Questions...

Post by paulsr » Tue Oct 23, 2012 10:47 am

Thanks, but I'm trying to build something into an app of my own. Basically, I want to be able to warn a user if the GPS accuracy/signal is not very good.

I think monitoring horizontal accuracy is the solution. It seems to be about 100m indoors (not that I want to measure distances indoors :) ) and drops to less than 10 meters outdoors.

--paul

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm

Re: GPS Questions...

Post by gpb01 » Tue Oct 23, 2012 11:06 am

paulsr wrote:.... and drops to less than 10 meters outdoors.

--paul
Mmmm ... I think that 10 mt. outdoors is still a good signal for an iOS device :) I start to consider data really unaccurate when horizontalAccuracy >= 50 mt ...

Guglielmo

Post Reply