Further testing (as of now) shows that the all-the-time access option is not necessary for the My Location testing application. As long as the app runs and it has the while-in-use permission, the app receives GPS updates, even if the Activity is sent to the background. Actually, closing the activity (at least in my case) via the Task selector does not stop the foreground Tracker service and therefore the My Location app continues to receive GPS updates via the GPS library. I have to actually go the the Applications list in settings and force stop the application before GPS updates to the application stop.
Tested with:
B4A 10.2
Android SDK 29
JDK OpenJDK 11.0.1 (From AnywhereSoftware's B4A page)
Application running on
Samsung Galaxy S9 (SM-G960U)
One UI version 2.1
Android Version 10
Kernel version 4.9.186-18803994
This is the B4A Manifest file
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="29"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>
)
'<!-- Required only when requesting background location access on
'Android 10 (API level 29) and higher. -->
'AddManifestText(
'<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
')
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.DarkTheme)
'End of default text.
SetServiceAttribute(Tracker, android:foregroundServiceType, "location")