-
-
Notifications
You must be signed in to change notification settings - Fork 241
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
Add optional background location tracking with saving to layer, in the background and including on QField / Phone restart #5742
Comments
Hi, I’m wondering if implementing a system to automatically start an app after a phone restart would be feasible or even practical. How would the app know when to launch, automatically activate the GPS, select the correct project (especially if multiple projects exist), and fill in the necessary fields? There could also be numerous potential challenges, such as how to handle field constraints if tracking is automatically initiated. QField already offers an option to start tracking when a project is opened. You can have fields auto-complete and simply validate the new feature to begin tracking. It requires a few steps, but the process is fairly quick—I use it myself. I’m not sure if the app stops tracking when running in the background, though. That would indeed be an issue. |
About the other problems, about how the layer can be known: Limit the auto tracking to one Project(the Last opened). Also, on starting tracking, the layer is know, and whether constraints are fullfilled. (could add a toggle box, persist Tracking e.g.) |
I come here to ask for same thing. Beside that the tracking feature is not working even if the app is running but in background or when the phone is locked. I am trying to have a polarstep like function on my side. |
This is technically not that hard (on Android), but it would have QField cross into a different realm of privacy considerations according to app store rules. FWIW, my view is that an app to just log location can be far simpler and lightweight, and doesn't need to be a GIS. Thus, it's best to keep this out of scope. Regardless it would be nice for those that control the app to say one of
|
@vincentBenet , @gdt , @werererer , you guys can try a PR build that introduces background tracking right here: #5917 Happy new year! :) |
QField~ Beta 5917 can't get the position always,and still can't tracking on background with my phone |
@CyberWanli , could you a/ provide a video showing you starting tracking in QField, then putting it in the background, then coming back to it? Doesn't have to be long, 15-20 sec will do. Do you see a notification popping up? Finally, after you turn your positioning on, tracking on, put QField in the background and come back to it, could you send over a manual log by going into the message logs (through the main menu) and hitting the "send application log"? Use your github handle in the optional details field so I can easily find your log in the database. Cheers. |
@nirvn the following video showing my tracking in QField. https://github.com/user-attachments/assets/723013ef-fa0d-4ff3-bed4-f8daa704ebff |
@CyberWanli , could you turn this "send anonymized metrics" option on: That'll make the "send application log" button visible here: One thing I'm perplexed about is the absence of notification in your status bar. With that APK, you should see these notifications when you are in the background: That makes me think maybe tge Redmi K40 didn't implement foreground service location support. We'd see that in the anonymized application metrics I'm referring to here. |
@CyberWanli , I see your log, thanks. I'm noticing this here: The |
@CyberWanli , did you accept the POST_NOTIFICATIONS permission when asked? That's required. As for the foreground service, I think your device runs on ~Android 11, which means that permission isn't required/used yet. |
@nirvn In the moning, I turned off the "allow notification badges" option. when i turn on , the screen can show the Qfield position result message, but Qfield didn't log the result to point or line tracking layer when the Qfield running in background. |
@CyberWanli , OK, helpful, could you share the test project you're using here? Maybe there's something specific to your point layer. One other test that'd be helpful to run: open the sample bees project, and use the Tracks line layer to track your position, and see if it works when put in background and coming back. |
|
Description:
It would be very beneficial to have an optional setting in QField that enables continuous location tracking, even when the app is running in the background, after a phone restart, or after QField is restarted. This location data would be automatically saved to a layer for later analysis.
Use case:
I want to track my position throughout the day and analyze patterns in my movement. By allowing QField to continuously track and save my location, even in the background or after a restart, this would make QField + QGIS highly flexible for long-term data collection and analysis.
Proposed feature:
Add an optional setting to enable background GPS tracking with saving directly to a layer.
Ensure this setting is disabled by default for privacy reasons.
Maintain location tracking after:
Phone restarts
QField restarts
Ensure the feature is optional and can be toggled on or off by users as needed.
Provide uninterrupted data logging without requiring manual intervention after restarts.
This enhancement would significantly improve the utility of location tracking for users needing seamless, continuous data collection.
Plattform
Android
The text was updated successfully, but these errors were encountered: