Android Question Manifest Editor and GPS in background

grafsoft

Well-Known Member
Licensed User
Longtime User
Hi,

I need GPS also in background, when the app sleeps (as most users will do or so I think).

In https://www.b4x.com/android/forum/threads/background-location-tracking-and-android-10.123355/ I read that I have to add the line
SetServiceAttribute(Tracker, android:foregroundServiceType, "location")
to the manifest.

When I do this, I see "module tracker not found".

Ths is the whole manifest

B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="29"/>
<supports-screens android:largeScreens="true" 
    android:normalScreens="true" 
    android:smallScreens="true" 
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
AddManifestText(<uses-feature android:name="android.hardware.location.gps"/>)
' aus dem forum
SetServiceAttribute(Tracker, android:foregroundServiceType, "location")
 
Solution
Does the original example work for you ?
Do you have in your app a service called Tracker?
1642607275657.png


If not, you should change the "Tracker" word in the SetServiceAttribute in the manifest to fit with the name of your service.

josejad

Expert
Licensed User
Longtime User
Does the original example work for you ?
Do you have in your app a service called Tracker?
1642607275657.png


If not, you should change the "Tracker" word in the SetServiceAttribute in the manifest to fit with the name of your service.
 
Last edited:
Upvote 1
Solution

grafsoft

Well-Known Member
Licensed User
Longtime User
Stupid me! I did not see the example, have not much idea about the manifest editor. The example seems to work, further tests will follow :) Thank you!
 
Upvote 0
Top