Android Question Any known problem using GPS library on Android 15?

marcick

Well-Known Member
Licensed User
Longtime User
A customer of mine with a fresh new Samsung S25 Android 15, reports that my app no longer shows the GPS position on the map.
I'm using the internal GPS library.
Is it a known problem?
 

DonManfred

Expert
Licensed User
Longtime User
I don´t know if it´s related:
 
Last edited:
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
A user with Android 15 solved the issue after I released an update where I switched from the GPS library to the GNSS library.
Another user with the same phone model (Samsung S25) still has the same problem.
I don’t need background location — GPS is only required while the app is open.
Do you still recommend switching to the method you linked, even in this case?
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
I'm not using GpsStatus event.

is "AddPermission(android.permission.FOREGROUND_SERVICE_LOCATION)" required if I just monitor the LocationChange event while the app is opened (no need to work in background) ?
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
I'm using GPS in my app since 5 years and I never never had any kink of problem with about 700 users. Til now with a couple of users with a fresh new Samsung S25 Ultra running Android 15.
I was using before the GPS library and moved now to GNSS library but no difference.
My code is the same of the example you link, asking runtime permission for FINE_LOCATION.
It works, but what happens is that sometime the app stop to receive location update (outdoor on a moving car).
To investigate I have put some code to log the location updates and every 10 seconds I verify that GPS is initialized and GNSS is enabled

B4X:
'This code every 10 seconds (it's a mistake I check twice GNSS.Enabled)
Writer.WriteLine(DateTime.Date(DateTime.Now) & ",GpsInitialized " & GNSS1.IsInitialized & ", GNSSEnabled " & GNSS1.GNSSEnabled & ", GNSSEnabled " & GNSS1.GPSEnabled)

'this code in LocManager_LocationChanged
Writer.WriteLine(DateTime.Date(DateTime.Now) & "," & Location1.Time & "," & Location1.Latitude & "," & Location1.Longitude & "," & Location1.Speed)

As can be seen in the log below, the GPS was working til 11:45:12 and then stopped to update locations while the user was driving the car with the app opened..
It was working again at 13:11:38 after about 1 hour and half. During all this time the user tried many times to exit and reenter the app, restart the phone etc with no success.
Also verified that GoogleMaps was working to be sure there are no problem of low signal.
The GPS is paused in Activity_Pause and restarted in Activity_Resume and also in B4XPage_Foreground.
I have abou 700 user with zero problems since years.

I'm thinking to give it a try with FusedLocationProvider.
Here the log.

B4X:
15/03/2025 11:41:44,1742035305000,45.60377214,9.30315245,3.690000057220459
15/03/2025 11:41:47,1742035308000,45.60374389,9.30325509,1.9900000095367432
15/03/2025 11:41:51,1742035312000,45.60372131,9.3033246,1.4199999570846558
15/03/2025 11:41:54,1742035315000,45.60369193,9.30338895,1.159999966621399
15/03/2025 11:42:04,1742035325000,45.60367308,9.30344735,1.7999999523162842
2025-03-15 11:42:05,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 11:42:07,1742035328000,45.60363828,9.30349991,1.7100000381469727
15/03/2025 11:42:10,1742035331000,45.60358107,9.30348838,1.9800000190734863
15/03/2025 11:42:13,1742035334000,45.60352743,9.30345114,1.809999942779541
15/03/2025 11:42:17,1742035338000,45.60348231,9.30339617,2.700000047683716
15/03/2025 11:42:20,1742035341000,45.60340542,9.30337439,3.059999942779541
15/03/2025 11:42:24,1742035345000,45.60337973,9.30344081,1.2899999618530273
15/03/2025 11:42:27,1742035348000,45.60336934,9.30353187,2.369999885559082
15/03/2025 11:42:30,1742035351000,45.60341819,9.30359673,2.380000114440918
15/03/2025 11:42:33,1742035354000,45.603491,9.30364582,2.890000104904175
15/03/2025 11:42:36,1742035357000,45.60355789,9.303685,2.190000057220459
15/03/2025 11:42:47,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 11:42:50,1742035371000,45.60361463,9.3036812,1.7300000190734863
15/03/2025 11:42:53,1742035374000,45.60366017,9.30358593,3.5999999046325684
2025-03-15 11:42:55,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 11:42:56,1742035377000,45.60362827,9.30347204,2.9100000858306885
15/03/2025 11:42:59,1742035380000,45.6035452,9.30343363,3.259999990463257
15/03/2025 11:43:02,1742035383000,45.60351125,9.30336456,1.2699999809265137
15/03/2025 11:43:12,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 11:43:24,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
2025-03-15 11:43:35,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 11:43:46,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 11:43:57,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 11:44:17,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
2025-03-15 11:44:25,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 11:44:26,GPS stopped !!!
15/03/2025 11:45:11,GPS started
15/03/2025 11:45:11,GPS started
15/03/2025 11:45:12,1742035513000,45.60353405,9.30335074,0
15/03/2025 11:45:17,GPS stopped !!!
15/03/2025 11:46:05,GPS started
15/03/2025 11:46:05,GPS started
15/03/2025 11:46:17,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 11:46:27,GPS stopped !!!
15/03/2025 11:50:14,GPS started
15/03/2025 11:50:14,GPS started
2025-03-15 11:50:15,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 11:50:24,GPS stopped !!!
15/03/2025 11:55:46,GPS started
15/03/2025 11:55:46,GPS started
15/03/2025 11:56:06,GPS started
15/03/2025 11:56:08,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
2025-03-15 11:56:17,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 11:56:25,GPS started
15/03/2025 11:56:38,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 11:56:49,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 11:56:53,GPS stopped !!!
15/03/2025 11:56:54,GPS started
15/03/2025 11:56:54,GPS started
15/03/2025 11:56:56,GPS stopped !!!
15/03/2025 11:56:59,GPS started
2025-03-15 11:57:00,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 11:57:09,GPS started
15/03/2025 11:57:15,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03 11:57,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
2025-03-15 11:57:41,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 11:57:52,GPS stopped !!!
15/03/2025 12:02:37,GPS started
15/03/2025 12:02:37,GPS started
15/03/2025 12:02:59,GPS stopped !!!
15/03/2025 12:04:51,GPS started
15/03/2025 12:04:51,GPS started
2025-03-15 12:04:52,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
2025-03-15 12:05:42,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:06:14,GPS stopped !!!
15/03/2025 12:06:33,GPS started
15/03/2025 12:06:33,GPS started
15/03/2025 12:06:36,GPS stopped !!!
15/03/2025 12:09:04,GPS started
15/03/2025 12:09:04,GPS started
2025-03-15 12:09:05,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:09:12,GPS started
15/03/2025 12:09:45,GPS stopped !!!
15/03/2025 12:09:52,GPS started
15/03/2025 12:09:52,GPS started
2025-03-15 12:09:53,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:10:02,GPS stopped !!!
15/03/2025 12:10:06,GPS started
15/03/2025 12:10:06,GPS started
15/03/2025 12:10:28,GPS stopped !!!
15/03/2025 12:10:30,GPS started
15/03/2025 12:10:30,GPS started
2025-03-15 12:10:41,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:10:57,GPS stopped !!!
15/03/2025 12:13:30,GPS started
15/03/2025 12:13:30,GPS started
15/03/2025 12:13:34,GPS stopped !!!
15/03/2025 12:15:10,GPS started
15/03/2025 12:15:10,GPS started
15/03/2025 12:15:27,GPS stopped !!!
15/03/2025 12:15:31,GPS started
15/03/2025 12:15:31,GPS started
2025-03-15 12:15:32,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:15:35,GPS stopped !!!
15/03/2025 12:16:46,GPS started
15/03/2025 12:16:46,GPS started
2025-03-15 12:17:17,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:17:39,GPS stopped !!!
15/03/2025 12:18:08,GPS started
15/03/2025 12:18:08,GPS started
2025-03-15 12:18:29,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:18:48,GPS stopped !!!
15/03/2025 12:19:30,GPS started
15/03/2025 12:19:30,GPS started
15/03/2025 12:19:34,GPS stopped !!!
15/03/2025 12:19:44,GPS started
15/03/2025 12:19:44,GPS started
15/03/2025 12:19:56,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:20:01,GPS stopped !!!
15/03/2025 12:20:11,GPS started
15/03/2025 12:20:11,GPS started
2025-03-15 12:20:12,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:20:31,GPS stopped !!!
15/03/2025 12:21:06,GPS started
15/03/2025 12:21:06,GPS started
15/03/2025 12:21:09,GPS stopped !!!
15/03/2025 12:21:33,GPS started
15/03/2025 12:21:33,GPS started
15/03/2025 12:21:45,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
2025-03-15 12:21:54,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:22:05,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:22:35,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:22:47,GPS stopped !!!
15/03/2025 12:24:32,GPS started
15/03/2025 12:24:32,GPS started
15/03/2025 12:24:38,GPS stopped !!!
15/03/2025 12:26:17,GPS started
15/03/2025 12:26:17,GPS started
15/03/2025 12:26:26,GPS started
15/03/2025 12:26:54,GPS stopped !!!
15/03/2025 12:26:58,GPS started
15/03/2025 12:26:58,GPS started
2025-03-15 12:26:59,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:27:10,GPS stopped !!!
15/03/2025 12:27:21,GPS started
15/03/2025 12:27:21,GPS started
15/03/2025 12:27:36,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:27:46,GPS stopped !!!
2025-03-15 12:30:14,GPS started
2025-03-15 12:30:14,GPS started
2025-03-15 12:30:15,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:30:26,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:30:37,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:30:44,GPS stopped !!!
2025-03-15 12:43:44,GPS started
2025-03-15 12:43:44,GPS started
2025-03-15 12:43:45,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
2025-03-15 12:44:05,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:44:20,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:44:31,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:44:42,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:44:48,GPS stopped !!!
15/03/2025 12:45:45,GPS started
15/03/2025 12:45:45,GPS started
2025-03-15 12:45:46,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:45:57,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:46:01,GPS stopped !!!
15/03/2025 12:46:02,GPS started
15/03/2025 12:46:02,GPS started
15/03/2025 12:46:14,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:46:25,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:46:29,GPS stopped !!!
15/03/2025 12:46:38,GPS started
15/03/2025 12:46:38,GPS started
2025-03-15 12:46:39,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:46:48,GPS stopped !!!
15/03/2025 12:55:56,GPS started
15/03/2025 12:55:56,GPS started
15/03/2025 12:56:19,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
2025-03-15 12:56:27,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:56:38,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:56:59,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:57:10,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
2025-03-15 12:57:17,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:57:23,GPS stopped !!!
15/03/2025 12:58:25,GPS started
15/03/2025 12:58:25,GPS started
15/03/2025 12:58:37,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:58:48,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:58:51,GPS stopped !!!
15/03/2025 12:58:51,GPS started
15/03/2025 12:58:51,GPS started
15/03/2025 12:58:52,GPS stopped !!!
15/03/2025 12:58:54,GPS started
15/03/2025 12:58:54,GPS started
2025-03-15 12:58:55,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:59:06,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:59:17,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:59:28,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:59:39,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
2025-03-15 12:59:45,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 12:59:56,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:00:07,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:00:18,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:00:29,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
2025-03-15 13:00:35,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:00:46,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:00:50,GPS stopped !!!
15/03/2025 13:05:15,GPS started
15/03/2025 13:05:15,GPS started
15/03/2025 13:05:20,GPS stopped !!!
15/03/2025 13:07:00,GPS started
15/03/2025 13:07:00,GPS started
15/03/2025 13:07:12,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
2025-03-15 13:07:21,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:07:32,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:07:43,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:07:54,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:08:01,GPS stopped !!!
15/03/2025 13:08:24,GPS started
15/03/2025 13:08:24,GPS started
2025-03-15 13:08:25,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:08:36,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:08:47,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:08:58,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:09:09,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
2025-03-15 13:09:15,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:09:26,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:09:37,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:09:48,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:09:59,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:10:10,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:10:21,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:10:32,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:10:43,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:10:54,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:11:05,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:11:15,GPS stopped !!!
15/03/2025 13:11:37,GPS started
2025-03-15 13:11:38,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:11:38,1742040698124,45.57206735,9.24753854,0
15/03/2025 13:11:49,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:12:00,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:12:11,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
2025-03-15 13:12:19,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:12:30,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:12:41,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:12:43,GPS stopped !!!
15/03/2025 13:20:10,GPS started
15/03/2025 13:20:10,GPS started
15/03/2025 13:20:10,1742041210903,45.57179536,9.24715451,0.3799999952316284
15/03/2025 13:20:22,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:20:25,1742041226000,45.57180688,9.24722307,0.6399999856948853
2025-03-15 13:20:31,GpsInitialized true, GNSSEnabled true, GNSSEnabled true
15/03/2025 13:20:32,1742041233000,45.57187015,9.24710736,2.9100000858306885
15/03/2025 13:20:35,1742041236000,45.57197245,9.24704485,5.300000190734863
15/03/2025 13:20:38,1742041239000,45.5721494,9.24702425,7.070000171661377
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
Absolutely not, believe be that I work with GPS since 25 years.
In this picture there is my app that show no position on the map (no LocationChanged event fired) while the box with googleMap navigation was working.
Something does not work with these Android 15 phones.
it can works all the morning for several hours then it starts to fail as you see in the previous log



Immagine WhatsApp 2025-03-16 ore 10.45.57_3ff343dc.jpg
 
Upvote 0

BlueVision

Well-Known Member
Licensed User
Longtime User
I don't think it's a problem with the library, either the smartphone really has no satellite reception or there are other reasons that just somehow stop satellite reception. This could be a power-saving mode of some kind on the mobile phone or something similar.
On my Samsung A55, I had significant problems using the old GPS library at all with Android 14. If the old GPS library was activated in the programme, the app could no longer be installed on the smartphone at all. The reason for this was the ‘outdated’ GPS library.
I would recommend that you expand your log. Also, count the satellites that are actively used with GNSS. Then you can at least rule out the factor of ‘insufficient satellite coverage’.
It could look something like the routine below, which probably still has a lot of room for optimisation. But it breaks down the available satellites by system. The important figure is the number of satellites ‘used in fix’. You probably won't need all the labels in your programme, but you can easily add them yourself.

Satellites used in fix:
Public Sub GNSS_GNSSStatus (Status As GnssStatus)
    Dim NumberOfSatellites As Int = Status.SatelliteCount
    Dim Beidou, Galileo, Glonass, Gps, Qzss, Sbas, Other As List
    Dim BeidouFix = 0, GalileoFix = 0, GlonassFix = 0, GpsFix = 0, QzssFix = 0 , SbasFix = 0, OtherFix = 0 As Int
    Beidou.Initialize
    Galileo.Initialize
    Glonass.Initialize
    Gps.Initialize
    Qzss.Initialize
    Sbas.Initialize
    Other.Initialize
    Dim usedinfix As Int = 0
    For i = 0 To NumberOfSatellites - 1
        Select Status.ConstellationType(i)
            Case Status.CONSTELLATION_BEIDOU
                Beidou.Add(i)
                If Status.UsedInFix(i) = True Then
                    BeidouFix = BeidouFix +1
                End If
            Case Status.CONSTELLATION_GALILEO
                Galileo.Add(i)
                If Status.UsedInFix(i) = True Then
                    GalileoFix = GalileoFix +1
                End If
            Case Status.CONSTELLATION_GLONASS
                Glonass.Add(i)
                If Status.UsedInFix(i) = True Then
                    GlonassFix = GlonassFix +1
                End If
            Case Status.CONSTELLATION_GPS
                Gps.Add(i)
                If Status.UsedInFix(i) = True Then
                    GpsFix = GpsFix +1
                End If
            Case Status.CONSTELLATION_QZSS
                Qzss.Add(i)
                If Status.UsedInFix(i) = True Then
                    QzssFix = QzssFix +1
                End If
            Case Status.CONSTELLATION_SBAS
                Sbas.Add(i)
                If Status.UsedInFix(i) = True Then
                    SbasFix = SbasFix +1
                End If
            Case Else
                Other.Add(i)
                If Status.UsedInFix(i) = True Then
                    OtherFix = OtherFix +1
                End If
        End Select
        If Status.UsedInFix(i) Then usedinfix = usedinfix + 1
    Next
    If PSatInfo.Visible = True Then
        LSBeidou1.Text = Beidou.Size
        LSBeidou2.Text = BeidouFix
        LSGalileo1.Text = Galileo.Size
        LSGalileo2.Text = GalileoFix
        LSGlonass1.Text = Glonass.Size
        LSGlonass2.Text = GlonassFix
        LSGps1.Text = Gps.Size
        LSGps2.Text = GpsFix
        LSQzss1.Text = Qzss.Size
        LSQzss2.Text = QzssFix
        LSSbas1.Text = Sbas.Size
        LSSbas2.Text = SbasFix
        LSOther1.Text = Other.Size
        LSOther2.Text = OtherFix
        LSTotal1.Text = NumberOfSatellites
        LSTotal2.Text = usedinfix
    End If
    Sats = usedinfix
End Sub
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
What you're saying is interesting to implement in order to get additional information. But if, while my app is not receiving the LocationChanged event, the Google Maps navigation overlay (as shown in the photo above) works perfectly, I don't think poor reception can be assumed.
 
Upvote 0

BlueVision

Well-Known Member
Licensed User
Longtime User
I agree with you. I was a bit curious and took a look at where you actually drive around...
You should have absolutely no ‘supply problems’ with satellite signals in that area. As a rule, there should be up to 30 satellites providing you with data, which leads to a very precise positioning.
I suspect the problem is more likely to come from a different direction. It could be any of a number of energy-saving functions or actions by the operating system itself that are paralysing your app. In addition to energy-saving functions, this also includes the possible termination of longer-running services in the operating system. Or another program module is interfering with the GNSS part (Fused Location Provider or similar). This is just a guess on my part.
Which target SDK is your app programmed for? If the SDK is 35, I would recommend that you perhaps first go back to SDK 34 and test again. I can imagine that this is quite a hassle for you. It is almost impossible to simulate. This only works with live data.
Another approach would be to try running a different programme with the GNSS library on the Android 15 smartphone. A programme without any other modules such as Fused Location Provider or similar modules that also serve to determine location. Just pure satellite communication. Nothing more.

I'll send you a PM.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
What you're saying is interesting to implement in order to get additional information. But if, while my app is not receiving the LocationChanged event, the Google Maps navigation overlay (as shown in the photo above) works perfectly, I don't think poor reception can be assumed.
I don't think that there is a problem with the library. It is a simple library.
Google Maps use FusedLocationProvider which can find the location based on other sources such as the cellular network.
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
Thanks everyone for your input.
Following BlueVision's suggestion, I added the GNSSstatus SUB to monitor the satellites and gave the APK to the client for testing.
It turned out that the GNSSstatus event is generated continuously without ever stopping, while the LocationChange event works for a while, then stops, and might reappear after 2 hours or so.
The screenshot below was taken at 8:55 PM, and you can see that the last GNSSstatus event is indeed from 8:55 PM (green label), with an impressive number of 45 satellites used for the fix, while the last LocationChange event goes back to 6:58 PM (blue label), almost two hours earlier.
This behavior, I repeat, only occurs with two clients who have the Samsung S25 Ultra with Android 15. As far as I know, Android 15 hasn't even been officially released yet (not even Google Pixel devices are shipping with Android 15) but Samsung went ahead anyway.
In my opinion, there’s some bug or incompatibility with the library, causing the LocationChange event to get lost.

I’m undecided whether to wait a bit to see if an update comes out for the Samsung S25 or switch to FusedLocation and see how that behaves.

IMG-20250316-WA0013.jpg
 
Upvote 0

BlueVision

Well-Known Member
Licensed User
Longtime User
1. Which is the MaxSDK - level of your app? I would recommend switching down to 34 for now and test again.
2. Is the GNSSpart controlled by a service in your program or just switched on/off generally? Problem could be a service, killed by the system for several reasons.
3. If Android 15 hardware is available to you, install my programm from the PM, check it's behave on Android 15. GNSS there is service independent. I ran it on my Samsung A55 (Android 14) for several hours without interruption. Check if it works for more than 2 hours on the mobile running Android 15. My APK's MaxSDK is 34.

Just wondering a little bit about the 90 minutes you told, after that your programme stops working. Sounds to me a little bit like a systemforced kill.
Check also the temperature of the mobile, if it becomes hot, then probably the system will kill energy-intensive-processes. I had this problem some years ago with weaker processors.

Generally I would not strip down to Fused Location Provider only. This is a significant decrease in position accuracy, minimum factor 10, probably much more.

Cheers
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
Hi, I'm on SDK 34 and not using services, just switching on/off GPS entering/exiting the app.
To me it sounds like a bug. There is nothing to kill and no battery to save if GNSS status always run and generate events and only the LocationChange event fails.
I'll ask my customer to test your app with Android 15, thanks
 
Upvote 0

BlueVision

Well-Known Member
Licensed User
Longtime User
In this case, when my app fails in the same way it is probably caused by a change done in Android 15.
 
Upvote 0
Top