Hi Graham

So, how do you define a "meaningful" GPS signal?

The GPS data you'll receive from locationChanged messages may have nothing for 
1-n messages at the start, followed by an increasingly accurate number of 
messages (as measured by the "horizontal accuracy" and/or "vertical accuracy" 
data items). The other apps will be utilising these to determine a "meaningful" 
signal. You can define that however you like, of course! :-)

Another thing you'll need to deal with is intermittent GPS signal which can 
happen for a number of reasons.

Anyway, good luck. LC can do the sensor stuff well I think, I'ill look forward 
to seeing what you come up with! 

cheers

Alan

> On 26 Apr 2020, at 7:11 pm, Graham Samuel <livf...@mac.com> wrote:
> 
> Alan, thanks for your two messages. II’m doing most of what you suggest (not 
> using accuracy so far, but the prudent person probably should do!), but 
> nevertheless I would like to emulate my fitness app example. I have apps that 
> positively know when they have acquired a meaningful GPS signal, whereas the 
> methods i’m using contain an element of chance or guesswork. I want to 
> completely eliminate that.
> 
> In practical terms, I can’t start the sensor until the user needs it, because 
> of battery drain - you will find this in most trekking and fitness apps - one 
> is more or less confined to a button ‘Start’ or something similar. At that 
> point, my ideal would be to show the user that I’ve started the sensor 
> acquisition and tell them when it’s succeeded or failed. I feel it has to be 
> possible, but perhaps not with LC.
> 
> Graham
> 
> 
>> On 26 Apr 2020, at 02:47, Alan Stenhouse <alanstenho...@hotmail.com 
>> <mailto:alanstenho...@hotmail.com>> wrote:
>> 
>> Hi Graham
>> 
>> Some ideas, from experience:
>> 
>> 1. Start your sensor on openStack or as soon as possible.
>> 
>> 2. Ignore locationChanged messages with empty location or if "horizontal 
>> accuracy" is outside a threshold of x metres.
>> 
>> 3. Just set a flag or other mechanism when you want to start and stop 
>> tracking which indicates to your locationChanged handler to record or stop 
>> recording the track.
>> 
>> Hopefully that sounds reasonable?
>> 
>> cheers
>> 
>> Alan
>> 
>>> On Sat, 25 Apr 2020 14:07:01,Graham Samuel <livf...@mac.com 
>>> <mailto:livf...@mac.com>> wrote:
>>> 
>>> 
>>> Typical fitness apps (such as iCardio by FitDigits)  can read various 
>>> sensors including a Heart Rate Monitor via Bluetooth, and one?s location 
>>> via inbuilt GPS. When you start an activity like a run or a workout, the 
>>> app goes through an acquisition phase, and won?t start recording until the 
>>> sensors are functioning. This is made clear to the user by a display.
>>> 
>>> I want to do this in my LC iOS app, specifically for the GPS. I know how to 
>>> start the location function on the device and I know how to handle the 
>>> position via ?locationChanged' and/or ?mobileCurrentLocation', and these 
>>> work. The big problem is at the start of such a sequence. I can use 
>>> 'mobileStartTracking Sensor ?location? ? to get going, but experience shows 
>>> that this takes an unpredictable amount of time, sometimes of the order of 
>>> seconds. You would think that the locationChanged messages wouldn?t start 
>>> firing until the start tracking process had done its job, but it seems this 
>>> is not so, and nonsense locations can appear at the beginning of the 
>>> sequence. At least that?s my experience.
>>> 
>>> I am loth to use a loop to see if the tracking is really started and legit, 
>>> and anyhow this would be problematical if my app was being inundated with 
>>> ?locationChanged' messages while the loop is running. 
>>> 
>>> Has anyone any experience of this issue? As usual, I feel I?m missing 
>>> something. Perhaps the ?trackingError? message might help, but I don?t see 
>>> how.
>>> 
>>> Graham
>> 
> 

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to