B4J Question read nmea sentence

suciwulans

Active Member
Licensed User
Longtime User
i have nmea sentence
$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47
how to get data every comma?
like this
123519 ---->12:35:19
4807.038 -----> 48 degree 07.038
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
There are two steps.
1. Get the components.
2. Evaluate each component.

Getting the components:
B4X:
Dim parts() As String = Regex.Split(",", NmeaString)

Example of formatting the time string:
B4X:
Dim rawTime As String = parts(1)
Dim t As String = rawTime.SubString2(0, 2) & ":" & rawTime.SubString2(2, 4) & ":" & rawTime.SubString2(4, 6)
 
Upvote 0

Similar Threads

Top