[Interest] [ Android ] Can Qt Positioning API access and output NEMA GPS Strings?

Edward Sutton edward.sutton at subsite.com
Tue Jul 28 15:22:04 CEST 2015

Thank you Alex,

On Jul 28, 2015, at 3:05 AM, Blasche Alexander <alexander.blasche at theqtcompany.com<mailto:alexander.blasche at theqtcompany.com>> wrote:

>I want to output NMEA strings that look like this:
>Maybe QNmeaPositionInfoSource has some way to output the raw source strings that it reads?

Well, the class' purpose is to process an incoming NMEA string. If I just want to output the raw strings then we wouldn't have to wrap the QIODevice providing the NMEA strings. We would directly print the content from the QIODevice ....

If you want to convert the output from a regular QGeoPositionInfoSource to NMEA then you would have to write the conversion code yourself. There is no support for it in Qt. It shouldn't be too difficult though as QNmeaPositionInfoSource provides a template for the reverse already.


I need to create the NMEA string from the QGeoPositionInfoSource properties for 3 message types; GPGGA, GNGNS, and GLGNS.

My concern is many NMEA fields are not exposed.  For example for GPGGA number of satellites, HDOP, DGPS reference station, etc.  I suppose I could fake missing field values and see how the device works.  For example time, lat, lon, and fake the remainder to nominal fields.

The alternative may be to make something similar to QtPositioning.java that uses GpsStatus.NmeaListener<http://developer.android.com/reference/android/location/GpsStatus.NmeaListener.html> instead of GpsStatus.Listener.  That appears to be much harder but would be a better solution in the long run.

I think I will try faking missing fields first.  For this application I am not sure if our device even cares which satellite system the data is coming from GPS or GLONASS.  The Android device may be connected to one or the other but I could always fake the output as GPGGA.

Thanks Alex,


Global Positioning System Fix Data

Name    Example Data    Description
Sentence Identifier     $GPGGA  Global Positioning System Fix Data
Time    170834  17:08:34 Z
Latitude        4124.8963, N    41d 24.8963' N or 41d 24' 54" N
Longitude       08151.6838, W   81d 51.6838' W or 81d 51' 41" W
Fix Quality:
- 0 = Invalid
- 1 = GPS fix
- 2 = DGPS fix  1       Data is from a GPS fix
Number of Satellites    05      5 Satellites are in view
Horizontal Dilution of Precision (HDOP) 1.5     Relative accuracy of horizontal position
Altitude        280.2, M        280.2 meters above mean sea level
Height of geoid above WGS84 ellipsoid   -34.0, M        -34.0 meters
Time since last DGPS update     blank   No last update
DGPS reference station id       blank   No station id
Checksum        *75     Used by program to check for transmission errors

This email and any files transmitted with it from The Charles Machine Works, Inc. are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this email in error please notify the sender. Our company accepts no liability for the contents of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150728/76f0034d/attachment.html>

More information about the Interest mailing list