Skip to content

knutsondc/RunTracker2

Repository files navigation

RunTracker2

Android app to track runs, walks, and drives and display on a GoogleMap. Primarily a learning device for me. Here's the basic structure: the launcher activity hosts a fragment that consists of a recyclerview holding a list of the runs that have been recorded or, if there are no runs recorded, a prompt to record one. From the list of recorded runs, the user can click on one of the runs displayed in the list, which will open a detail page concerning that run, or choose to create a new run from the options menu, which will open a blank detail page for the new run. Each detail page is a fragment managed by a second activity which consists of a ViewPager that allows one to swipe from one run to the next. The user clicks the Start Button that appears on the detail page to start or continue tracking this run. If a run is being tracked, the Stop Button on that detail page will become enabled, thus allowing the user to stop tracking the run. If a run is being tracked, the Start Button will be disabled, as will the options menu selection to create a new run. If there are at least two locations recorded for a run, the Map Button on its detail page will be enabled. Clicking on that button will start a third activity that hosts a MapFragment displaying the route the run has followed. The MapFragment has an options menu that allows the user to make some modest changes in how the run is tracked on the map.

When the user clicks the Start Button on the detail page of a run, a background service requests location updates from the system. Location updates from the system are detected by a Broadcast Receiver (TrackingLocationReceiver.java) which in turn calls a method in the RunManager class (a singleton utility class) that causes the location to be recorded in an Sqlite database together with the run it's associated with. The recording of the changes to the database tables for the runs recorded and the location updates is watched by a ContentObserver which causes Loaders for the run and location data to be presented to the UI elements.

This project started from the RunTracker app found in the first edition of Big Nerd Ranch's Android programming book that came out in 2013. Since then, I've built upon that base to add features that will help me (a beginning programmer) learn more about Android software development.

About

Track runs, walks, and drives and display on a GoogleMap. Primarily a learning device for me.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages