GPS Tracker

October 22, 2020 (4y ago)

To learn more about integrating interactive maps (such as Google Maps or Mapbox) and WebRTC in mobile applications, I decided to create a GPS Tracker mobile app.

The app allows users to track their own location, create routes, share their location in real-time, and make video calls. This app can be used to track a traveling family member, share a road trip with a friend, or record your own bike ride.

Users can share a unique passcode with people they want to be tracked by. This passcode allows others to track their location.

Tech Stack

Functionality

Save, Edit, and View Routes

While tracking, after covering a minimum distance (default is 10 meters), users can save the current route. If they choose to save it, they will be prompted to provide details about the route.

Users can later view and edit their saved routes.

Sharing Location

When the mobile app is first launched, a unique ID is generated. This ID is specific to the mobile app and can be reset by clearing the app’s data.

This ID can be used to view the GPS location of the person using the standalone web application. Entering a valid ID will display the tracker's GPS location on an interactive map.

Video Call (up to 2 peers in the latest version)

When the WebRTC option is enabled in the settings menu, the tracker can request a video call via the web application.

WebRTC uses STUN and/or TURN servers to establish a peer-to-peer connection between users.

Source Code

The source code for this project can be found here.

You can download a debug APK from here.

Please note that this APK does not contain any Firebase credentials, so it will not store tracked data in the backend.

If you want to use a STUN/TURN server and/or Firebase (for remote tracking), you will need to build the project yourself with the appropriate keys.