I would like to implement an `exercise timer` feat...
# compose-wear
y
I would like to implement an
exercise timer
feature with compose wear that user can start and stop the exercise. Is there any example for this? What are the options and recommendations on wear? App Widgets, Tiles, Music App like Always on App? Horologist or Glance? Thanks for any hints.
y
Tile and Complication work. I think favour Tiles Material over glance, given it's Alpha state. Horologist has helpers for both tiles and complications.
Look at ongoing activities for something running in the background.
y
Thanks, I will try Tiles Material from Horologist and ongoing activities as recommended, which may give more viewports than that of the complication.
y
Tiles Material is an androidx lib.
The functionality in horologist helps with testing, previews and sharing Compose Canvas code with the app and tile.
y
thanks, it looks great. Can the tile also be synced with mobile app widget somehow? I see some music player has this feature.
y
Via the data layer, yes. Or through your server/firebase AKA the cloud
f
y
@florent Thank you very much. The exercise example looks great. It seems to use ongoing activity, always on activity and custom services.
f
You can use compose already if you use glance
y
Is it not still in alpha? How is your experience with glance, does it support your daily work well?
I looked through an example of Glance, https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:glance/g[…]a/androidx/glance/wear/tiles/demos/CurvedLayoutTileService.kt Which is really simple compared to TileMaterial, I think i will stick with TileMaterial still due to the alpha stage of glance.
j
Glance is still early days, and while it uses compose runtime it is different from building compose UI apps as you don't have the same state model. Glance is still in very early stages of development and doesn't have all of the features available in Tiles. I would stick to Tiles Material for now