The 7 Things I Know About Cyber Security After 25 Years | April 2024
Trending Time - data-driven watch face development for Android Wear
1. Trending Time
See what’s hot on Twitter - on your wrist!
A primer on data-driven watch face development for Android Wear
2. Project goals
● Build a content-centric watch face
● Use best practices, but steer slightly off-
course from conventions in Google’s sample
app
● No user OAuth - just install, activate & enjoy!
3. A funny thing happened...
● Watch Face API launched December 2014
● Seemingly everyone built one
● Not many data-driven projects
● I wanted to do a community tutorial
● I suck at art
6. A utility delivering utility
● Surfaces top trends
● High entertainment
value
● Usually hilarious, often
informative, sometimes
helpful
7. This is where wearables rock
● Microinteractions: <= 3-second sessions
● Stay in the know without leaving the moment
● Not bothered by constant notification pelting
8. Variation on a theme
● The core element of designing watch faces
is the creative expression of time
10. Variation on a theme
● With Trending Time, the timekeeping
function takes a backseat to the watch being
a portable stage for quick, relevant
information
11. One line & you’re done
WatchFaceStyle.Builder(this)
.setShowSystemUiTime(true)
...
.build();
12. Account for the peek card
.setCardPeekMode(WatchFaceStyle.PEEK_MODE_SHORT)
16. How is a watch face made?
● If you said…
○ “It’s like building a live wallpaper!”
○ “It’s like building a game!”
○ “It’s like building an animation loop!”
18. Under the hood: two apps
● All cloudtalk happens on the phone
○ Background service calls Twitter’s API
○ AlarmManager schedules hourly invocations
○ Updated trending topics stored in a DataMap
● Data auto-syncs to watch over Bluetooth
○ If devices lose pairing, data is buffered & sent when
connectivity is restored
19. ● Wearable service listens for changes
○ Content persisted in SharedPreferences
○ (Will eventually migrate to a BroadcastReceiver)
● Redraws only when screen is active
○ Invalidate display in onPropertiesChanged event
Under the hood: two apps
20. Usage
1. Launch mobile app
2. Tap “Start updater”
3. Close mobile app
4. Select “Trending
Time” watch face
21. The engineering trifecta
● Performant
○ No need for FPS stress
○ Avoids interval- or tick-based loops
● Scalable
○ Proxy handler minimizes API calls; preserves quota
● Battery-friendly
○ Diverts from AsyncTask-based timer pattern
○ Same impact in interactive mode & ambient mode
22. Drawbacks
● Watch faces aren’t interactive
○ A service, not an activity
○ Read-only relay
● Let the user drill-down into actual tweets
○ Trends selected on the watch handled on the phone
by Twitter’s app or Chrome
23. Roadmap: UI goodies
● Topics presented
as a tag cloud
while maintaining
glanceable ethos
● User-defined
trending regions
● Contextual inputs