
Posted by Michael Stillwell – Developer Relations Engineer
This publish is a part of Put on OS Highlight Week. Right this moment, 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 singular and rewarding problem that encourages you to suppose past cellular patterns. Put on’s design philosophy focuses on crafting experiences for a tool that is all the time with the person, the place significant interactions take seconds, not minutes. A profitable wearable app does not try to maximise display time; it as an alternative 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 important, requiring you to construct experiences which might be each stunning and battery-conscious. You will additionally deal with challenges like dealing with offline use instances and catering for a number of display sizes.
Regardless of these variations, you may end up on acquainted technical foundations. Put on OS relies on Android, which implies you’ll be able to leverage your present information of the platform, structure, developer APIs, and instruments to create wearable experiences.
Put on OS surfaces
Put on OS affords a spread of surfaces to tell and interact customers. This lets you tailor your app’s presence on the watch, offering the proper info on the proper time and scaling your improvement funding to greatest meet your customers’ wants.
Watch faces show the time and are the very first thing a person sees after they take 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 advanced duties which might be too concerned for different surfaces.

Notifications present glanceable, time-sensitive info and actions.

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

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

While a wide range of Put on OS surfaces let builders to interact with customers in numerous methods, it might be overwhelming to get began. We advocate approaching Put on OS improvement in phases and scale up your funding over time:

- Enhance the wearable expertise of your cellular app. You’ll be able to enhance the wearable expertise with minimal effort. By default, notifications out of your telephone 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 determined by the telephone app for its core options and knowledge. This entails making a tethered app that works in tandem along with your telephone app, permitting you to design a custom-made UI for the wrist and make the most of surfaces like tiles and problems.
- Graduate to a standalone app. Lastly, you’ll be able to evolve your app right into a standalone expertise that works independently of a telephone, which is right for offline eventualities like exercising. This offers 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 person. As a result of Put on OS relies on Android, it shares the identical notification system as cellular gadgets, letting you leverage your present information to construct wealthy experiences for the wrist.
From a improvement perspective, it helps to think about a notification not as a easy alert, however as a declarative UI knowledge construction that’s shared between the person’s gadgets. You outline the content material and actions, and the system intelligently renders that info to greatest swimsuit the context and kind issue. This declarative method has change into 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 telephone app are mechanically “bridged”, or mirrored, to a related watch, offering an prompt wearable presence in your app with no additional work. These bridged notifications embody an motion to open the app on the telephone.
You’ll be able to improve this default habits by including wearable-specific performance to your telephone notifications. Utilizing NotificationCompat.WearableExtender, you’ll be able to add actions that solely seem on the watch, providing a extra tailor-made expertise with no need to construct a full Put on OS app.
// Stipulations: // // 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 prolong( NotificationCompat.WearableExtender().apply { setSmallIcon(R.drawable.new_mail_wear) } ) } .construct() NotificationManagerCompat.from(applicationContext).notify(0, notification)
Forestall 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 telephone app are bridged by default, a person with each your telephone and watch apps put in may see two alerts for a similar occasion.
Put on OS offers a simple approach to handle this:
- On the cellular app’s notification, assign a string identifier utilizing setBridgeTag().
- In your Put on OS app, you’ll be able to then programmatically stop 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 cellular and watch apps generate related however distinct notifications, you’ll be able to hyperlink them utilizing setDismissalId(). When a person dismisses a notification on one gadget, any notification with the identical dismissal ID on one other related gadget can be dismissed.
Creating interactive experiences
From a person’s perspective, apps and tiles might really feel very related. Each are full-screen experiences which might be visually wealthy, help animations, and deal with person interplay. The principle variations are in how they’re launched, and their particular capabilities:
- Apps may be deeply immersive and deal with advanced, multi-step duties. They’re the apparent selection when dealing with knowledge that should be synced between the watch app and its related telephone app, and the one selection 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 may 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 helpful UI toolkit for constructing them – it really works seamlessly with different Jetpack libraries and accelerates improvement productiveness. Many distinguished apps, like Gmail, Calendar and Todoist, are constructed completely with Compose for Put on OS.
Compose for Put on OS for stunning UIs
In case you’ve used Jetpack Compose for cellular improvement, you may discover that Compose for Put on OS shares the identical foundational ideas and psychological mannequin. Nonetheless, constructing for the wrist requires some completely different methods, and the toolkit offers 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 an alternative of the cellular 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 cellular, 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 gadgets on the fringe of a spherical display, enhancing legibility. It additionally has built-in help for scrolling with rotary enter.
- Navigation: Dealing with display transitions and the again stack additionally requires a element that’s particular to Put on OS. As an alternative of the usual NavHost, you could use SwipeDismissableNavHost. This element works with the system’s swipe-to-dismiss gesture, making certain customers can intuitively navigate again to the earlier display.
Learn to use Jetpack Compose on Put on OS to get began, together with pattern code.
Implementing core app options
Put on OS additionally offers APIs designed for energy effectivity and the on-wrist use case, in addition to Put on OS variations of cellular APIs:
- Authentication: Credential Supervisor API unifies the person sign-in course of and helps fashionable, safe strategies like passkeys, passwords, and federated id providers (like Signal-in with Google), offering a seamless and safe expertise with out counting on a companion telephone.
- Well being and Health (sensor knowledge): Whereas you need to use the usual Android Sensor APIs, it is not really helpful for efficiency causes, particularly for long-running exercises. As an alternative, use Well being Providers 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 price to operating metrics, with no need to handle the underlying sensors instantly.
Constructing tiles
Tiles provide fast, predictable entry to the data and actions customers want most, accessible with a easy swipe from the watch face. Through the use of platform knowledge bindings to show sources like step depend or coronary heart price, you’ll be able to 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—important issues on a wearable gadget. Be taught extra about find out how to get began with tiles and find out how to make use of pattern tile layouts.
Extra sources 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 consists of templates for frequent layouts, letting you shortly bootstrap your personal designs whereas following greatest practices.
There has by no means been a greater time to begin constructing for Put on OS. In case you have suggestions on the APIs, please tell us utilizing the difficulty trackers for Put on Compose and Tiles. We stay up for seeing what you construct!
