Android Question GPS Raw Data

solfinker

Member
Licensed User
Longtime User
How can I read GPS raw data?
I need GPS information in RINEX format, that is, measurements from several satellite constellations.

Thank you.
 

DonManfred

Expert
Licensed User
Longtime User
GPS does not allow (as far as i know) to select specific Satellites.
I think this is not possible. I may be wrong though.

I don´t know if it is possible to get raw-data as GPS is an Android-Feature. We only get a new Location trough Events.

Maybe this (found in forum)?
B4X:
Public Sub Initialize
    MyGPS.Initialize("MyGPS")
    If MyGPS.GPSEnabled = False Then
        StartActivity(MyGPS.LocationSettingsIntent) 'Will open the relevant settings screen.
    Else
        MyGPS.Start(0, 0)
    End If
End Sub

Public Sub Destroy()
    MyGPS.Stop
End Sub

Private Sub MyGPS_NMEA (TimeStamp As Long, Sentence As String)
   Log(Sentence)
End Sub
 
Last edited:
Upvote 0

agraham

Expert
Licensed User
Longtime User
The most detailed information on individual satellites that can presently be obtained in B4A is by using my GNSS library which is a superset of the GPS library.
It will give you this data for each satellite though this is probably not what you want.
 
Upvote 0

solfinker

Member
Licensed User
Longtime User
Thank you.
You say that
Reports whether the satellite at the specified index has ephemeris data.
HasEphemerisData(int satIndex)

but, do we get the ephemeris data?
 
Upvote 0

solfinker

Member
Licensed User
Longtime User
I came across this infographic





referring to differences between Marshmallow and Nougat and purports to explain that we do now have no black box but the raw data themselves, which I suppose is wrong since I found GnssStatus which is exactly what you explained.
It contains, therefore, the following Public methods
describeContents()
equals()
getAzimuthDegrees()
getBasebandCn0DbHz()
getCarrierFrequaencyHz()
getCn0DbHz
getConstellationType()
getElevationDegrees()
getSatelliteCount()
getSvid()
hasAlmanacData()
hasBasebandCn0DbHz()
hasCarrierFrequencyHz()
hasEphemerisData()
hashCode()
usedInFix()
writeToParcel()

And no ephemeris data.

Thank you again.
 
Upvote 0

Lakhtin_V

Active Member
Licensed User
Longtime User
Your library can solve my problem. I want to get the exact time from the GPS without using the system time. It is important for me to get the exact time to 1 millisecond. But the system time in android on different smartphones shows different times = - 1-5 seconds sometimes more. I hope that the time from the GPS on all devices located nearby in one place will be the same. As an option, is it possible to force Android to correct the internal clock according to the GPS all the time? because the time from cellular operators is less accurate.
I need to synchronize clocks on different devices with maximum accuracy
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
The only time available is the time of fix in the Location object passed to the LocationChange event. I doubt that this can be relied on as an indication of the current time. In fact, I doubt that you can reliably get 1mS precision on any timings in an Android app as all events are indeterminately invoked off the application message loop which stalls when any other event code is running as there is only the single main thread handling everything.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…