GPS : lat/long coordinates are too short!

As you know the GPS/GNSS chipset of smartphones becomes more and more accurate (30 cm accuracy with the last Broadcom chip). With location sensor in AI2 I get a problem : the coordinates provided are with 5 digits and it is not enought to work with centimeter accuracy… Is it possible to get lat/long coordinates with a least 7 digits ?
Is there a way to get a GPS calculation at least each second ?
Thank you.

5 digits is what is returned from the GPS satellite’s NEMA file and what is used by the LocationSensor. It is not possible to achieve centimeter accuracy. Read about how to use the LocationSensor here Using the Location Sensor

The LocationSensor uses the NEMA $GPRMC string to report it’s geocoordinates. The actual data of the $GPRMC string is hidden from the user). The precision is FIVE decimal places and is what the original satellites report. Sorry, you cannot get the accuracy you hope using App Inventor. Instead, program with AndroidStudio that has the libraries necessary to use advanced chip set capabilities.

Is there a way to get a GPS calculation at least each second? Not really. You only get a revised location when the LocationChanged event fires. Since it typically takes 20 seconds for the GPS to revise a satellite fix, updating more frequently than about each 20000 ms produces no practical results. Yes, you can set the LocationChanged event to attempt to trigger every 1000 ms but the new coordinates will not report that fast.

Regards,
Steve

(added to gps and geofences section of FAQ)

In fact NMEA message is not limited to 5 digits. Think of GPS receivers used by surveyors. They work with 1cm accuracy and their GPS uses NMEA messages

So I’ve made a test to compare things using AI2 and Sketchware (bloc editor that allow to build programs from your Android device).
In the screen copy you’ll see that it is possible to get a good accuracy for position.
So what’s wrong ???

And here a screen copy of gps coordinates you get if you use AI2 :frowning:

Steve, you are right AI2 should use GGA instead of RMC NMEA message :
$GPGGA,172814.0,3723.46587704,N,12202.26957864,W,2,6,1.2,18.893,M,-25.669,M,2.0,0031*4F

https://www.trimble.com/OEM_ReceiverHelp/V4.44/en/NMEA-0183messages_MessageOverview.html

Yup, more accuracy will solve a trouble that made me stop a project

Hi Bertrand,
does this example work for you?

p185D_nmeaMessage7.aia (41.5 KB)

Hi Juan,

Look what I get :

GPGGA with 5 decimals.

Can you run Screen2 and Screen3?

this extension is based on this class:
https://developer.android.com/reference/android/location/OnNmeaMessageListener?hl=es

Great I get more decimals on GGA with your app

Now 1 big problem,
Is there anyway you can share that extension with us? I really need that and I have no clue how to make it. Thank you!

OK, problem solved.
All you need to do is just put an extension to the project, download the .aia file, and stuff those extensions after opening achieve via 7zip.
Just putting this here for anyone that hasn't figure out yet.

*Thank you so much guys for the extension.

Extension is here:

http://kio4.com/appinventor/285D_extension_Nmea.htm