OpenTracks icon indicating copy to clipboard operation
OpenTracks copied to clipboard

Add a way to launch the stats dashboard from public API

Open kflpk opened this issue 6 months ago • 6 comments

Is your feature request related to a problem? Please describe. I'm trying to use Tasker to automatically start the recording when using an NFC tag. Currently I don't think there is a way to launch the statistics dashboard (not the map) from the public API.

Describe the solution you'd like A new public API function function to launch the dashboard for currently recorded track, or a parameter to StartRecording to do the same thing.

Describe alternatives you've considered Currently I only have Tasker launch the app, but it kinda defeats the purpose, as I have to click on the screen anyway.

Additional context

https://github.com/user-attachments/assets/693880a2-290e-4abe-acbf-ed362434be1b

kflpk avatar Jun 29 '25 15:06 kflpk

Would be useful to start the statistics UI always directly (as it happens if you start the recording via UI)?

dennisguse avatar Jun 29 '25 15:06 dennisguse

I'm not sure. I think another API class/parameter would be better. Some people would probably prefer if it ran in the background and it would break their workflow. Works for me, though ¯_(ツ)_/¯

kflpk avatar Jun 29 '25 15:06 kflpk

Can you do the change yourself? It is in StartRecording and should just be a call to startActivity(TrackRecordingActivity).

dennisguse avatar Jun 29 '25 15:06 dennisguse

I could try, BUT I don' know anything about programming in Java and Android development. I barely got the intent working, as I am not familiar with the project's codebase nor Android APIs.

kflpk avatar Jun 29 '25 15:06 kflpk

Then one last question: OpenTracks starts the UI if triggered via the PublicAPI or am I mistaken?

dennisguse avatar Jun 29 '25 15:06 dennisguse

No, the app on the video is launched independently via Tasker. When using StartRecording the recording starts in the background, and only a notification is displayed.

kflpk avatar Jun 29 '25 15:06 kflpk