GpxPlayer Android is a lightweight companion app for GpxPlayer Desktop. It listens for broadcast intents that describe a location (and optional speed) and injects that data as mock GPS coordinates on the device. This allows the desktop application to drive location-based testing on an Android emulator or device.
- Exposes a broadcast receiver for
org.nitri.gpxplayer.ACTION_SET_LOCATIONintents with ageo:URI payload. - Converts the incoming coordinates into a mock location and sets them for GPS (and network) providers.
- Prompts users to grant mock location permissions if the app is not configured as the mock location app in Developer Options.
- Android Studio (or the Android SDK + Gradle).
- Device or emulator running Android 6.0+ (minSdk 23).
- Developer Options enabled, with GpxPlayer selected as the mock location app.
./gradlew assembleDebugInstall the APK on a connected device/emulator:
./gradlew installDebugGpxPlayer Desktop (or any client) should send a broadcast intent with a geo: URI and an optional speed extra.
- Action:
org.nitri.gpxplayer.ACTION_SET_LOCATION - Data URI:
geo:LAT,LON - Extras:
speed(integer, km/h) — optional, defaults to 3.
adb shell am broadcast \
-a org.nitri.gpxplayer.ACTION_SET_LOCATION \
-d "geo:37.4219983,-122.084" \
--ei speed 12If the app is not set as the mock location provider, it will open Developer Options and prompt you to select GpxPlayer.
MainActivityhandles the permission alert UI.MockLocationReceiverreceives broadcast intents and forwards them to the provider.MockLocationProviderconfigures test providers and injects mock location updates.
- No location updates: confirm Developer Options ➜ Select mock location app is set to GpxPlayer.
- Broadcast ignored: verify the intent action and that the data URI starts with
geo:.
See LICENSE.