Does MobileSensorReading work?

John Dixon DixonJA at
Fri May 26 11:10:11 EDT 2017

You must start the 'sensor' first... usually done in your openStack handler... as in :-

on openStack

if environment() = "mobile" then

  mobileStartTrackingSensor "location", false

end if

end openStack

on locationChanged latitude, longitude

   set the theCurrentLocation of this stack to latitude & comma & longitude

end locationChanged

then as your location changes, the locationChanged message will give you the new lat/long 😊


From: use-livecode <use-livecode-bounces at> on behalf of Jonathan Lynch via use-livecode <use-livecode at>
Sent: 26 May 2017 15:56
To: How to use LiveCode
Cc: Jonathan Lynch
Subject: Does MobileSensorReading work?

I put a button on my app and put the app on my iPhone.

The button had the following script:

on mouseUp

put MobileSensorReading("location",true) into tReading

answer the Keys of tReading

answer tReading

end mouseUp

I figured this would tell me if the function was supposed to return an
array or a variable, since I had read both online.

Interestingly, it returned empty for both.

Do all things with love
use-livecode mailing list
use-livecode at
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
Runtime Revolution - use-livecode Mailing List<>
This mailing list is intended for discussion relating to using LiveCode. To see the collection of prior postings to the list, visit the use-livecode Archives

More information about the Use-livecode mailing list