Is my phone using L1 or L5?

255 views
Skip to first unread message

Louis Elston

unread,
Nov 28, 2021, 7:41:40 PM11/28/21
to GPSTest
Samsung S21+.  GPSTest shows L1 and L5.  Using Visual Studio 2020, Maui (C#), Wrote app using Maui.essentials.  Did Best, High, Medium, Low, Lowest.  Here is code...

-------------------------------------------------------------
private void OnButtonClicked(object sender, EventArgs e)
        {
            GetLocBest();
            GetLocHigh();
            GetLocMedium();
            GetLocLow();
            GetLocLowest();
        }

        async void GetLocBest()
        {
            try
            {
                var request = new GeolocationRequest(GeolocationAccuracy.Best, TimeSpan.FromSeconds(10));
                cts = new CancellationTokenSource();
                var location1 = await Geolocation.GetLocationAsync(request, cts.Token);

                if (location1 != null)
                {
                    BestLatLongLabel.Text = "Best = Lat: " + location1.Latitude + " / Long: " + location1.Longitude;
                }
            }
-------------------------------------------------------
Did all 5 calls, one after the other, standing in the same spot.  All five beginning values were the same (42. \ -71), but did change in the last four digits.  

I did your accuracy test, it showed 42.8176600\=71.1517012.  My app (exact same spot), showed 42.817787236.

Is there a way to determine if my app is using L1 or L5?  

Is there any point in trying to specify the accuracy of the call to GeoLocation, in that they all return the same values?  

Is there a way to determine if the phone ( my app (what is GPSTest using)), is using the phones magnetometer, or L1\L5, from the satellites?  

And finally (using the example of trying to walk a property line), because the the not so accurate results from the phone (5 Meters plus\minus?) would it be more accurate to use a hand held compass?

Louis Elston

unread,
Dec 5, 2021, 8:40:52 AM12/5/21
to GPSTest
A week, and no replies.  This is obviously the wrong forum for this posting.  Where should I repost on?

Knut

unread,
Dec 8, 2021, 12:28:46 PM12/8/21
to GPSTest
Hi,
just a few (if belated) comments.

In general, you cannot control from any app which frequencies and which constellations are used to obtain a position fix. This is because this functionality is compartmentalized in a dedicated piece of hardware, a GNSS receiver chip (or a comparable section of the phone's SoC), which tells you via a NMEA message stream which satellites it can see, but you can't tell that chip which satellites/frequencies to use. So running GPStest in parallel to your app and looking at the (U) flags gives you a reasonable indication of what the chip currently uses, since your and GPStest are working with the same output from the chip.

GNSS position reports are inherently noisy, so seeing a small delta between what your app reports and what GPStest reports a second or two later is normal.

Magnetometers are for orientation sensing, not for position sensing, in that sense your phone will use the magnetometer when you ask it for a heading information. With pure GNSS, you can only get a heading while moving. A hand-held compass will not give you more accuracy when eg establishing a property line, but maybe a higher quality heading information.

sorry that I can't help you with another forum, I would put the API calls you mention into google search and see if anything turns up beyond Android Online API docs.

Cheers,

Knut

PS: The one way to specify which freq and satellites you are using, is to implement your own GNSS receiver functionality based on GNSS_Raw_Measurements API. But this is quite an amount of work...

Sean Barbeau

unread,
Dec 8, 2021, 2:26:05 PM12/8/21
to GPSTest
Sorry, I somehow missed the original post. I work on GPSTest on my lunch breaks so things inevitably slip through the cracks :).

 >Using Visual Studio 2020, Maui (C#), Wrote app using Maui.essentials.
>Did all 5 calls, one after the other, standing in the same spot.  All five beginning values were the same (42. \ -71), but did change in the last four digits.  

So this is a totally different platform than GPSTest, which is a native Android app. This platform is another layer on top of the native Android APIs. Does this platform tell you what location provider was used for the location fix?

GPSTest requests locations directly from the GPS_PROVIDER using the Location API:

...which is as close as a pure GNSS solution as you can get. To match to this in your app, the location provider for each fix should be "gps". Again, not sure if this is accessible via the APIs you're working with. It depends how they are mapping values like "GeolocationAccuracy.Best" to the underlying Android APIs.

>Is there any point in trying to specify the accuracy of the call to GeoLocation, in that they all return the same values?  

 My guess is that they are mapping these values to:

...which again, isn't how GPSTest works - it directly requests the GPS_PROVIDER.

>Is there a way to determine if my app is using L1 or L5?  

Again, not sure for the platform you're using. In native Android, you can get data from the GnssStatus API:

...and the "usedInFix()" method will tell you if a particular signal (which also has carrier frequencies to determine L1 or L5) was used in the last position fix - GPSTest shows this as a "U" in the Flags column on the Status screen.

See this article for more info on dual-frequency in the APIs:

>Is there a way to determine if the phone ( my app (what is GPSTest using)), is using the phones magnetometer, or L1\L5, from the satellites?  

Yes on L1/L5 (see above), no on magnetometer/gyro.

>And finally (using the example of trying to walk a property line), because the the not so accurate results from the phone (5 Meters plus\minus?) would it be more accurate to use a hand held compass?

IMHO yes, a high-quality compass will likely be more accurate than a phone if you're trying to walk in a particular direction from a fixed point.

Sean
Reply all
Reply to author
Forward
0 new messages