lostzen / lost

A drop-in replacement for Google Play services location APIs for Android
http://mapzen.github.io/lost/
Other
352 stars 70 forks source link

Fix mock trace tests and sample app #127

Closed ecgreb closed 8 years ago

ecgreb commented 8 years ago

Overview

Refactors mock GPX trace logic so it can be tested synchronously. Cleans up classes and adds interfaces to facilitate testing.

Updates sample app to load a mock GPX trace from its external files directory. Previously the trace file was loaded from the root of the SD card which now fails due to insufficient permissions.

This is cleaner than adding the required permissions for accessing all of external storage and is the now the recommended way for developers to use mock traces in a runtime permissions world.

Also adds fastestInterval to sample app location request since this is required for mock trace replay to work correctly (background thread sleeps for fastestInterval between each location update).

Adds utility script install-gpx-trace.sh to make it easier to copy a GPX trace file into an application's external files directory on an emulator or device.

Fixes #84

sarahsnow1 commented 8 years ago

These changes are great. We might want to update the mock-locations-routes.md instructions to add your new script. Maybe something like:

# Install GPX File
To install your gpx file onto your device, run the install script included in this repo:
install-gpx-trace.sh <trace file> <package name>

Example:
install-gpx-trace.sh lost.gpx com.example.myapp
ecgreb commented 8 years ago

@sarahlensing good call. Updated docs to include gpx install script.

https://github.com/mapzen/lost/pull/127/commits/577396a5cbb659cd30a088eee3c8c7ee2fb1586e