-
Notifications
You must be signed in to change notification settings - Fork 4
Data communications architecture
Trending Time uses the Android Wear SDK's Data API to manage syncing of downloaded content between the mobile and wearable apps. All data communications happens in the mobile app on the phone - once per hour, a service on the phone calls a custom proxy I built that's hosted on Google App Engine, which in turn taps Temboo's Twitter library to access the Twitter Trends API for the 'USA' region. I did this to prevent repeated requests from maxing-out my Temboo quota.
The content is stored in a DataMap.
This event signals a change that's synced to the wearable app, which takes the modified data and persists it into a SharedPreferences item. This item is accessed within the service that manages the watch face. Since the UI doesn't have to have fluid animation, the watch face itself is invalidated and redrawn not on a time- or tick-based interval, but any time the onPropertiesChanged() event fires. This is a more conservative approach to saving battery life than constant redraws dependent on some sort of loop.
You can find out more wearable tips in my book, Designing and Developing for Google Glass, by O'Reilly & Associates. Thanks for your support! :)