So you will want to store your location data using the Data Layer API, and when the phone reconnects with the wearable later, the data will be automatically synchronized. When the wearable is being taken out for a run, especially with the built-in GPS, there may not be a phone present. When writing an app that runs on the wearable, you will eventually want to synchronize the data it collects with the paired phone. You do not need to deal with the low-level implementation details yourself. However, for the most part, deciding which GPS to use, and sending the position from the phone to the wearable, is handled automatically. You will need to delete this and provide a graceful recovery mechanism, such as a message telling the user to bring their phone with them. One case you’ll need to handle is if the phone is not connected to the wearable and the wearable does not have built-in GPS. If the phone is not connected to the wearable and the wearable has a built-in GPS, then it uses the wearable’s GPS. If the phone is connected to the wearable, it uses the GPS on the phone and sends the updates to the wearable. Further, and more importantly there’s already a fair number of Android Wear apps out there today. Still, the flexibility of the Android Wear platform certainly makes for an interesting way to create a bike computer. This is the same API that has been available on mobile, so you can easily reuse your existing code and samples.įusedLocationProviderApi automatically makes the most power-efficient decision about where to get location updates. Android Wear devices are wrist-based, as the branding sorta implies. On the wearable, use the FusedLocationProviderApi from Google Play services to request location updates.
#MYTRACKS ANDROIDWEAR FOR ANDROID#
Implementing GPS location updates for Android Wear is simple. In application settings you can set the time interval wherein SyncMyTracks check for new activities, or you can disable automatic synchronization. If you make a new activity with any of your accounts, it automatically syncs to the others accounts. The Golfshot wearable app uses built-in GPS to calculate your distance to the next hole, even when you don’t have your phone with you. Simply add the accounts you want to sync, and SyncMyTracks will do the synchronization.