
Android Wear Docs, Release 1.1
8.2 Verify GPS Sensor
This simple example works for all wearables, with or without a GPS sensor. Those without GPS must pair with a
handheld to get location updates. A more complete implementation verifies the presence of a GPS sensor and pairing
status before using location services, and warns users or reduces functionality when necessary. You can verify the
presence of a GPS sensor as follows:
getPackageManager().hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS
8.3 Example
The working example for this section is at https://github.com/LarkspurCA/WearableGPS.
8.4 Golf Rangefinder Example
Golf is an activity where you often want to know the distance to the next hole so you can choose the perfect club for
the shot. There are plenty of rangefinders on the market today, but few are as small and convenient as a smart watch.
The golf rangefinder example (Clipon Caddie) is a sample application that utilizes the GPS concepts in this section
to perform a useful task for golfers, to determine the current location and display the number of yards to the current
hole. The full source code code is available at https://github.com/GolfMarin/CliponCaddie and the installable app is
at http://cliponcaddie.com.
40 Chapter 8. Wearable GPS
Comentarios a estos manuales