Skip to content
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

[Statistics/Overall Season/API] Provide a Means for OSM Dashboard to be Able to Use Overall Season Statistics for Runs #87

Closed
Trim0500 opened this issue Mar 13, 2024 · 3 comments · Fixed by #119 or #129
Assignees
Labels
enhancement New feature or request High Priority Mission critical issues Overall Season (Group #8) Specific tasks related to overall season statistics services Statistics Tasks related to statistics service functions

Comments

@Trim0500
Copy link
Collaborator

Trim0500 commented Mar 13, 2024


Feature Request

  • The mapping software of the OSM Dashboard Companion App allows a user to see an interactive map of their tracks along with some stats on the same screen. This along with the upcoming social features will require that these functions are accessible.
  • The issue would be to provide a way for OSM Dashboard to access all the data for individual runs by providing an API controller integration that gets stats based on a single trail, or a group of them.

Proposed Solution

  • Utilize the OpenTracks public API interface to extend a request to get the information required. And utilize a similar response message as the existing interface for run information.

Alternatives

  • Establish a new method to access the metrics, however that could greatly increase overall effort required as well as development time.

Additional context

Parent Issue

#5

OSM Dashboard Issue

rilling/OSMDashboard-Winter-2024-COMP-354#11

@Trim0500 Trim0500 added enhancement New feature or request Statistics Tasks related to statistics service functions Overall Season (Group #8) Specific tasks related to overall season statistics services High Priority Mission critical issues labels Mar 13, 2024
@Trim0500 Trim0500 self-assigned this Mar 17, 2024
@Trim0500 Trim0500 changed the title [Statistics/Overall Season/API] Provide a Means for OSM Dashboard to be Able to Use Overall Season Statistics [Statistics/Overall Season/API] Provide a Means for OSM Dashboard to be Able to Use Overall Season Statistics for Runs Mar 18, 2024
@Trim0500
Copy link
Collaborator Author

Trim0500 commented Mar 18, 2024


Notes

  • Chain of methods that call the Dashboard: onOptionsItemSelected -> showTrackOnMap -> onFormatSelected -> startDashboard

  • Essentially gets the options defined in the references to then prompt a display for the user (assuming that they have yet to select a file format). If the user already choose an option, it will use that option and pass the params to the onFormatSelected method.

    • Note that OSM is called Intent.OpenTracks-Dashboard internally by the app
    • Choosing the OSM option will refer to using the companion app and push the selected track data onto that app
  • showTrackOnMap (util/IntentDashboardUtils)

    • Send intent to show tracks on a map (needs an another app) as resource URIs. Shows an AlertDialog with different format option if none is defined as preference.
    • context the context
    • isRecording are we currently recording?
    • trackIds the track ids
  • onFormatSeleected (util/IntentDashboardUtils)

    • A format was selected, remember if always is true and start the necessary action
    • context the context
    • isRecording are we currently recording?
    • selectedValue the chosen format
    • trackIds the track ids
    • always set the selectedValue as default preference
  • startDashboard (util/IntentDashboardUtils):

    • Send intent to show tracks on a map (needs an another app) as resource URIs. By providing a targetPackage and targetClass an explicit intent can be sent, thus bypassing the need for the user to select an app.
    • context the context
    • isRecording are we currently recording?
    • targetPackage the target package
    • targetClass the target class
    • trackIds the track ids
  • Uses URI's as a payload for the dashboard app.

    • content://de.dennisguse.opentracks.debug.content/tracks/{trackId}
    • content://de.dennisguse.opentracks.debug.content/trackpoints/trackid/{trackId}
    • content://de.dennisguse.opentracks.debug.content/markers/trackid/{trackId}
  • These URIs are used by OSM to read the data (since it is given explicit read permission). They act as database connection strings. The models are outlined in the data/models directory.

    • On the OSM side, the MapsActivity.java file uses on overriden OnNewIntent method to verify that the intent sent over by OpenTracks and then get the payload information to then read the URIs and get the data
  • How should I be pushing over the data for a run? Do i need to push over many runs?


@Trim0500
Copy link
Collaborator Author

Trim0500 commented Mar 19, 2024


  • A commit has been made to the branch that outlines a possible implementation, however a number of issues are required to be completed for a concrete implementation

@Trim0500
Copy link
Collaborator Author


  • While the idea of the integration is represented, the lack of proper data from other groups limits the scope of the implementation and some unknowns regarding data connection strings to send over still exist. For now, I will close down this issue. Any future work on this integration should be carried out in a new issue once all the specific details are ironed out by other groups.

@Trim0500 Trim0500 linked a pull request Mar 25, 2024 that will close this issue
Trim0500 added a commit that referenced this issue Mar 25, 2024
---
## Context
- Seeking to add in some implementations for generating reports of
All-Time overall ski stats
- A new page has been added, accessible through the aggregated stats
page
- A new class has been added in using a singleton pattern to encapsulate
all-time overall ski stats
- An OSM dashboard integration has been added, accessible from the new
page to push these stats

## Issue Links
- #85 
- #86 
- #87 
- #88 
- #89 
---
@Trim0500 Trim0500 mentioned this issue Mar 25, 2024
@Trim0500 Trim0500 linked a pull request Mar 25, 2024 that will close this issue
Trim0500 added a commit that referenced this issue Mar 25, 2024
---
### Description
- Seeking to add in some rudimentary overall ski stats implementations
into main

### Issue Links
- #85 
- #86 
- #87 
- #88 
- #89 
- #21 
---
Picard4 added a commit that referenced this issue Apr 29, 2024
Patched the LeaderboardFragment child classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request High Priority Mission critical issues Overall Season (Group #8) Specific tasks related to overall season statistics services Statistics Tasks related to statistics service functions
Projects
None yet
1 participant