OneBusAway/onebusaway-android — pull request #149 by barbeau (2014-07-11 19:13:55+00:00)
Title: Fix #64 - Add support for Location Services

This is a fully working version of Location Services (but still using Maps API v1, and original Location API for map location).

This includes:
* Bump `minSdkVersion` from `8` to `9`, so we can use the most recent version of Google Play Services, and continue to update as new versions are released (API level 9 is the current baseline for Play Services)
* Fallback to platform Location API v1 if Location Services aren't available, or if the Location Services location is older than Location API v1 location. There are some [known issues](https://code.google.com/p/android/issues/detail?id=64597) with Google Play Services location, and hopefully this fallback will use a Location API v1 location when Location Services falls apart.
* Refactoring `GeoPoint` out of main project packages, and use `Location` instead
* All uses of `GeoPoint` and other Maps API v1-specific classes have been refactored into `.map.googlemapsv1` package. I've also abstracted the MapMode/RouteMap/StopMapControllers further to remove Maps API v1-specific implementation details, and push this code into a `.map.googlemapsv1.ObaMapViewV1` class and a new `MapView` interface in MapModeController. In theory, this should make it much easier to swap out Google Maps API v1 for v2, or any other maps provider, including those have have 1-to-1 parity with Google Maps APIs (OSM. Amazon, Mapquest, etc.)
* New tests for Location-related code. Parts of these tests automatically determine whether they are running on a device or emulator, and only execute tests that require non-null locations on devices (since emulators by default don't return locations from Location API or Location Services). These tests could be extended in the future to inject locations into the emulator for Travis testing (see [Android docs](http://developer.android.com/training/location/location-testing.html) and [SO answer](http://stackoverflow.com/a/2279827/937715)).
* New LocationHelp utility class
* Refactor other utility classes into new `.util` package

@paulcwatts This is ready for testing by others, and I don't know of any issues with it (i.e., it seems to work fine on my Galaxy S3 with Android 4.4), but due to the number of changes I'd prefer to have this tested by a number of beta testers before being pushed out to the general public. I plan to use this as a base for #56 as well, since many of the above items were done in preparation for #56.