-
-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When starting OpenTracks via GadgetBridge no data is being recorded #1904
Comments
Might be #1653. If the screen is off, some Android devices might enforce permission to access the location in the background. Can you check if it works, if the screen is on? |
Also does not work with screen on. I see that only Gadgetbridge is accessing Location and on Opentracks a new record is being created but directly stopped with no data. |
Can you check if there is a crash happening (check logcat)? |
Can you start a recording (that has data) via the UI? |
Yes, with the UI it works. |
I have the same issue when starting to track via intents (I have a device that I use only for sport activities and use tasker to start tracking once the connection is established). It creates a track of 0 seconds and that's all. Manually starting to track works without issues. |
Same here |
Came here to report this exact issue, glad to find it's already known! |
Logcat:
Specifically this line seems to be the culprit:
|
I have the same issue and I observed the following:
Those issues did not occur before 03 APR 2024. I'm using nightly via F-Droid on Andorid 12. |
This also happens to me on either Android 14 (SM-A1560) for using Automate/App Start Block or adb shell intent ,or Android 11 (Waydroid) for using adb shell intent. I'm using v4.13.0 on both machine Also I did 2 logcats on Waydroid, one is for "Activating GPS in main UI by touching the GPS button then run the intent", the other is "Start the main UI without touching the GPS button then run the intent". I use fake GPS to emulate GPS on Waydroid. And it can record on both machine by pressing the recording button in the main UI. Here's "Activating GPS in main UI by touching the GPS button then run the intent" logcat:
Here's "Start the main UI without touching the GPS button then run the intent" logcat:
logcat on SM-A1560 is so messy that I have no idea how to treat it. I'm sorry. |
oh wait... I see that after Android 11 (API 30) you need to somehow grant the user ACCESS_FINE_LOCATION then ask them for ACCESS_BACKGROUND_LOCATION. (will this be persistence?) after reading this and the issue you mentioned. Idk if I can help, but i'd like to try. But idk how's the progress now yet. (sorry) I think your can add two button in the Setting/PublicAPI option, one of them is "Get GPS permission", and the other "Allow running in the background" will be present or enable after clicking the above one? Since the user is already getting their hands on APIs, I think we can just let the user know the fact that it's Android forcing us to do so? |
nvm i wanna do something else for now. reading java code is a huge pain to me even with ChatGPT and Android Studio |
I would think, it is unnecessary, because this issue popped up somewhen in Spring of this year. Probably some change in the code broke the functionality. |
Looks like a permission issue: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false
|
I don't think there's a need for background permission. I read that app can have permission to do so if runs as foreground service(with a notification) from google's doc. |
Indeed, the service is trying to launch foreground notification while being itself launched from background (intent). That's the issue it seems. Which is bizarre because the intent does not call the service directly, but call an activity (which should bring the app on foreground) |
@Just-Explode Here a fix Just changed the "AbtractApiActivity.java" "onCreate" method. Replaced
By
Not a all a stable fix ok. |
OMG it's really glad to see a potential fix, I will definitely try! |
When starting a new recording with my Mi Band 7 via Gadgetbridge a new recording is being started with opentracks but directly after the start stopped and no data is being recorded.
I know from old recordings that is worked until at least 2024-03-02, I just discovered that all other recordings are empty since then.
This is only the case when started via Gadgetbridge (via intent?), normal recording works. I checked all the settings, they seem to be correct.
...
Checklist
Technical information
The text was updated successfully, but these errors were encountered: