Posted by Michael Stillwell – Developer Relations Engineer
This put up is a part of Put on OS Highlight Week. At present, we’re specializing in creating participating experiences throughout the varied surfaces obtainable on the wrist.
Growing for the rising ecosystem of Put on OS is a novel and rewarding problem that encourages you to suppose past cell patterns. Put on’s design philosophy focuses on crafting experiences for a tool that is all the time with the consumer, the place significant interactions take seconds, not minutes. A profitable wearable app would not try to maximise display screen time; it as a substitute goals to ship significant glanceable experiences that assist individuals keep current and productive whereas on the go. This imaginative and prescient is now absolutely enabled by the following technology of {hardware}, which we explored final week with the introduction of the brand new Pixel Watch 4.
Put on OS gadgets additionally introduce constraints that push you to innovate. Energy effectivity is vital, requiring you to construct experiences which can be each stunning and battery-conscious. You may additionally sort out challenges like dealing with offline use circumstances and catering for a number of display screen sizes.
Regardless of these variations, you may end up on acquainted technical foundations. Put on OS is predicated on Android, which suggests you may leverage your present data of the platform, structure, developer APIs, and instruments to create wearable experiences.
Put on OS surfaces
Put on OS gives a spread of surfaces to tell and have interaction customers. This lets you tailor your app’s presence on the watch, offering the best info on the proper time and scaling your growth funding to greatest meet your customers’ wants.
Watch faces show the time and are the very first thing a consumer sees once they have a look at their watch. We’ll cowl watch faces in additional element in different weblog posts throughout Put on OS Highlight week.

Apps present a richer, extra immersive UI for complicated duties which can be too concerned for different surfaces.

Notifications present glanceable, time-sensitive info and actions.

Problems show highly-glanceable, related knowledge out of your app straight on the consumer’s chosen watch face. Study extra about constructing complication knowledge sources for Put on OS.

Tiles (Widgets for Put on OS) supply quick, predictable entry to info and actions with a easy swipe from the watch face.

While quite a lot of Put on OS surfaces let builders to interact with customers in several methods, it could be overwhelming to get began. We advocate approaching Put on OS growth in phases and scale up your funding over time:

- Enhance the wearable expertise of your cell app. You may enhance the wearable expertise with minimal effort. By default, notifications out of your cellphone app are mechanically bridged to the watch. You can begin by enhancing these with wearable-specific actions utilizing NotificationCompat.WearableExtender, providing a extra tailor-made expertise with out constructing a full Put on OS expertise.
- Construct a companion expertise. Whenever you’re prepared for a devoted UI, create a tethered app expertise that is dependent upon the cellphone app for its core options and knowledge. This includes making a tethered app that works in tandem along with your cellphone app, permitting you to design a personalized UI for the wrist and make the most of surfaces like tiles and issues.
- Graduate to a standalone app. Lastly, you may evolve your app right into a standalone expertise that works independently of a cellphone, which is good for offline eventualities like exercising. This gives essentially the most flexibility but additionally requires extra effort to optimize for constraints like energy effectivity.
Notifications
Notifications are a core a part of the Put on OS expertise, delivering glanceable, time-sensitive info and actions for the consumer. As a result of Put on OS is predicated on Android, it shares the identical notification system as cell gadgets, letting you leverage your present data to construct wealthy experiences for the wrist.
From a growth perspective, it helps to consider a notification not as a easy alert, however as a declarative UI knowledge construction that’s shared between the consumer’s gadgets. You outline the content material and actions, and the system intelligently renders that info to greatest swimsuit the context and type issue. This declarative method has grow to be more and more highly effective. On Put on OS, for instance, it is the mechanism behind ongoing actions.
Alert-style notifications
One wonderful thing about notifications is that you do not even want a Put on OS app in your customers to see them on their watch. By default, notifications generated by your cellphone app are mechanically “bridged”, or mirrored, to a linked watch, offering an on the spot wearable presence in your app with no further work. These bridged notifications embody an motion to open the app on the cellphone.
You may improve this default conduct by including wearable-specific performance to your cellphone notifications. Utilizing NotificationCompat.WearableExtender, you may add actions that solely seem on the watch, providing a extra tailor-made expertise without having to construct a full Put on OS app.
// Conditions: // // 1. You have created the notification channel CHANNEL_ID // 2. You have obtained the POST_NOTIFICATIONS permission val channelId = "my_channel_id" val sender = "Clem" val topic = "..." val notification = NotificationCompat.Builder(applicationContext, channelId) .apply { setContentTitle("New mail from $sender") setContentText(topic) setSmallIcon(R.drawable.new_mail_mobile) // Added for Put on OS lengthen( NotificationCompat.WearableExtender().apply { setSmallIcon(R.drawable.new_mail_wear) } ) } .construct() NotificationManagerCompat.from(applicationContext).notify(0, notification)
Stop duplicate notifications
When you construct a devoted app for Put on OS, you may have to develop a transparent notification technique to keep away from a standard problem: duplicate notifications. Since notifications out of your cellphone app are bridged by default, a consumer with each your cellphone and watch apps put in may see two alerts for a similar occasion.
Put on OS gives an easy strategy to handle this:
- On the cell app’s notification, assign a string identifier utilizing setBridgeTag().
- In your Put on OS app, you may then programmatically forestall notifications with sure tags from being bridged utilizing a BridgingConfig. This offers you fine-grained management, permitting you to bridge some notifications whereas dealing with others natively in your Put on OS app.
In case your cell and watch apps generate comparable however distinct notifications, you may hyperlink them utilizing setDismissalId(). When a consumer dismisses a notification on one system, any notification with the identical dismissal ID on one other linked system can be dismissed.
Creating interactive experiences
From a consumer’s perspective, apps and tiles could really feel very comparable. Each are full-screen experiences which can be visually wealthy, help animations, and deal with consumer interplay. The principle variations are in how they’re launched, and their particular capabilities:
- Apps will be deeply immersive and deal with complicated, multi-step duties. They’re the apparent alternative when dealing with knowledge that should be synced between the watch app and its related cellphone app, and the one alternative for long-running duties like monitoring exercises and listening to music.
- Tiles are designed for quick, predictable entry to the data and actions customers want most, offering glanceable content material with a easy swipe from the watch face. Consider tiles as widgets for Put on OS.
Apps and tiles are constructed utilizing distinct applied sciences. Apps will be constructed with Jetpack Compose, whereas tiles are outlined declaratively utilizing the ProtoLayout library. This distinction permits every floor to be extremely optimized for its particular function – apps can present wealthy, interactive experiences whereas tiles stay quick and power-efficient.
Constructing apps
Apps present the richest expertise on Put on OS. Jetpack Compose for Put on OS is the really useful UI toolkit for constructing them – it really works seamlessly with different Jetpack libraries and accelerates growth productiveness. Many outstanding apps, like Gmail, Calendar and Todoist, are constructed solely with Compose for Put on OS.
Compose for Put on OS for stunning UIs
Should you’ve used Jetpack Compose for cell growth, you may discover that Compose for Put on OS shares the identical foundational rules and psychological mannequin. Nevertheless, constructing for the wrist requires some totally different methods, and the toolkit gives a specialised UI element library optimized for watches.
Put on OS has its personal devoted Materials Design, basis, and navigation libraries to make use of as a substitute of the cell Jetpack libraries. These libraries present UI elements tailor-made for spherical screens and glanceable interactions, and are every supported by Android Studio’s preview system.
- Lists: On cell, you would possibly use a LazyColumn to show a vertical assortment of things. On Put on OS, the TransformingLazyColumn is the equal element. It helps scaling and transparency results to objects on the fringe of a spherical display screen, enhancing legibility. It additionally has built-in help for scrolling with rotary enter.
- Navigation: Dealing with display screen transitions and the again stack additionally requires a element that’s particular to Put on OS. As an alternative of the usual NavHost, you have to use SwipeDismissableNavHost. This element works with the system’s swipe-to-dismiss gesture, making certain customers can intuitively navigate again to the earlier display screen.
Learn to use Jetpack Compose on Put on OS to get began, together with pattern code.
Implementing core app options
Put on OS additionally gives APIs designed for energy effectivity and the on-wrist use case, in addition to Put on OS variations of cell APIs:
- Authentication: Credential Supervisor API unifies the consumer sign-in course of and helps trendy, safe strategies like passkeys, passwords, and federated identification companies (like Signal-in with Google), offering a seamless and safe expertise with out counting on a companion cellphone.
- Well being and Health (sensor knowledge): Whereas you should utilize the usual Android Sensor APIs, it is not really useful for efficiency causes, particularly for long-running exercises. As an alternative, use Well being Companies on Put on OS. It acts as an middleman to the varied sensors, offering your app with batched, power-efficient updates for every part from coronary heart fee to working metrics, without having to handle the underlying sensors straight.
Constructing tiles
Tiles supply fast, predictable entry to the data and actions customers want most, accessible with a easy swipe from the watch face. By utilizing platform knowledge bindings to show sources like step rely or coronary heart fee, you may present well timed and helpful info in your tile.
Tiles are constructed declaratively utilizing the ProtoLayout libraries, that are optimized for efficiency and energy effectivity—vital issues on a wearable system. Study extra about tips on how to get began with tiles and tips on how to make use of pattern tile layouts.
Extra assets for constructing experiences for Put on OS
- Put on OS Documentation Hub: The important useful resource for builders trying to create experiences for Put on OS, from design tips to code samples.
- WearTilesKotlin pattern app: Demonstrates the basics of constructing a tile but additionally contains templates for widespread layouts, letting you rapidly bootstrap your individual designs whereas following greatest practices.
There has by no means been a greater time to start out constructing for Put on OS. When you have suggestions on the APIs, please tell us utilizing the problem trackers for Put on Compose and Tiles. We look ahead to seeing what you construct!