I'd like some high-level input on how I'm approaching a watch face I'm building as a teaching tool. It's quite simple - grabbing trending topics from Twitter once an hour and displaying them on the watch. Basically, my flow is as follows:
- I have an AlarmManager on the paired phone that polls the Twitter API and pulls down fresh data, set to fire a BroadcastReceiver
- When invoked, the BroadcastReceiver uses the Data Layer API to send a one-way message to the wearable containing the downloaded data
- Upon receipt, the wearable app saves the inbound data to SharedPreferences as a persistent data store and redraws the topics to the watch face from SharedPreferences
Presumably this all happens in the background, whether the watch face is actively being displayed or not.
I'm thinking alternatively I could also save the Twitter data to SharedPreferences on the phone app and then use more elegant Data Layer API syncing job between the phone and watch that's triggered when the watch face becomes visible. Or, running things on the wearable via the Lollipop JobScheduler API.
Anyone see any glaring areas I could design better? Thanks!