LocationSensor Extension. Accuracy. Geocoder. GeomagneticField

Hello friends,

this Extension is about:

1.- SensorLocation.

  • It uses the classes:



In those pages you can find information about:
getLatitude, getLongitude, getAltitude, getSpeed ​​(m/s), bearing, bearingTo, distanceTo, getTime and convert.

bearingTo and distanceTo refers to the Properties: LatitudeTo and LongitudeTo.

Bearing: https://en.wikipedia.org/wiki/Bearing_(navigation)
Bearing online: https://www.sunearthtools.com/tools/distance.php

2.- Geocoder.

Blocks: getFromLocation and getFromLocationName

adminArea, countryCode, countryName, feature, locality, phone, postalCode, premises, subAdmin, subLocality, subThoroughfare, thoroughfare, url

  • It uses the classes:



3.- GeomagneticField.

declination, fieldStrength, horizontalStrength, inclination, x, y, z

  • It uses the classes:



Earth’s Magnetic North Pole Has Officially Moved (Toward Russia):

4.- This app uses LocationSensor Extension (black text) and LocationSensor of MIT App Inventor (blue text).

On the Map Screen, the coordinates of the red dot are obtained with the Extension and those of the blue dot with MIT App Inventor.

p185C_sensorlocalizacion.aia (33.5 KB)

You can download the com.KIO4_LocationSensor.aix extension of:

Juan Antonio Villalpando.


With Kodular you can also use Google Maps:

Hi Juan,

I’ve made a test with your extension because I try to get centimeter accuracy for some applications. The number of digits provided by AI2 when you get latitude/longitude gives you an accuracy of 10 meters witch is not enought in some cases.
My problem is that using it I don’t get more digits and also no information about accuracy (this information is available in the GST NMEA message)
Do you have any idea ?

Hello Bertrand,

I have published two extensions about GPS:

in both I obtain a value of latitude and longitude with 5 decimals and an accuracy of approximately 3 … 5 meters.
I think that the accuracy of centimeters can be obtained with Galileo satellites, but I have not used that technology.

1 Like

Hi Juan,

In fact you can get something like less than one meter accuracy with the new dual frequency GNSS chipsets that you have in Samsung Snapdragon or Xiami Mi8 and +

You can also get 1cm accuracy on your smartphone if you connect the external Trimble Catalyst antenna…
Applications are endless…

Is there a way to get also the $GST NMEA message (location accuracy) ?
Are your extensions published on the MIT extension repository ? It’s not clear on your website witch one is the latest one.
I’ve made a test but it doen’t work. Do you seesomething wrong in my blocs ?
Thank you

Try this
Nmea_30.aia (15.6 KB)

I can get GN—, but not GP—

Look what I have with the Nmea_30 program

Juan your extension and example are super.
it compares very well to my garmin Vista
great job


  • Information about Galileo (GPS in Europe).

Galileo’s capabilities have grown with the addition of a new High Accuracy Service, freely available worldwide to anyone with a suitably equipped receiver. Delivering horizontal accuracy down to 20 cm and vertical accuracy of 40 cm,