We all need exercise. Or at least some time outside of the house every day. We found that it's hard to do this on a regular basis because of just how boring it can get. We found that jogging, or even walking a dog, is much more exciting when I we get to explore new places. But after walking down what feels like every road on the block, runs started to get boring. It feels like choosing between a few of the same paths every time.
What it does
RNJogger makes running more enjoyable by making every trip a unique and exciting experience. By giving it a distance, how far you want to run or walk, it determines a random route for you to run or walk around your neighbourhood. This keeps things exciting and provides motivation to go outside by taking the monotony out of the task. When you approach an intersection, the app will use audio cues to tell you to turn or proceed on your current path. Simply type in your distance, plug in your headphones, and run!
How we built it
RNJogger was built using React Native, Mapbox, and OpenStreetMap map data. We used React Native to create navigation and a UI for the app. Mapbox is used to display the map and render the calculated route as an additional layer on top. When the user generates a route, the app first gets the user's location and downloads OpenStreetMap data of the map around the user, which gets parsed and processed by a custom algorithm.
Challenges we ran into
We were faced with the challenge of defining an "interesting route". After a lot of deliberation, we decided that an interesting route had the following properties.
- Does not backtrack
- Does not cross the same node more than twice
- Utilises many turns
- Crosses landmarks
Most of our programming trouble stemmed from drawing the map: we had trouble accessing free map tilesets, downloading tiles for offline usage, and rendering our path on our map.
Accomplishments that we are proud of
We're proud of creating a unique pathfinding algorithm that is able to work with OpenStreetMap. Finding paths of k length in a weighted graph is known to be computationally expensive, but finding paths of approximately k length is an interesting challenge.
We're also proud of putting together a fully functional app in such a short period of time, especially considering we've never used React Native.
What I learned
We learned a lot about how React Native works, especially the Native Modules API which allowed to run the native Java code that allowed us to get the location and process the OpenStreetMap data. We learned how XML data can be parsed in Java, as well as enough about the Android API to generate log messages to debug our code. We also needed to use Android Studio to create virtual Android devices and connect our phones to test our app on physical devices.
What's next for RNJogger
If RNJogger attracts enough users, it may be worthwhile for us to include non-intrusive ads to allow us to make a profit. We plan to release this app on the Google Play Store, and if we find it picking up enough traction there, we might also release it on the App Store, for which one must pay to get a license.