Tag Archives: Wear OS

Wear OS Tiles Material Library: Build Tiles, Fast.

Posted by Anna Bernbaum, Product Manager, Ataul Munim, Developer Relations Engineer

We are excited to announce the launch of the Tiles Material library! Now, instead of building buttons, progress arcs and more from scratch, you can use our pre-built Material components and layouts to create tiles that embrace the latest Material design for Wear OS. You can use these together with the Tiles Design Kit to easily follow the Tiles Design Guidelines.

Tiles provide Wear OS users glanceable access to the information and actions they need in order to get things done quickly. They also are one of the most used surfaces on Wear OS. Just one swipe away from the watch face, users can quickly access the most important information or actions from an app, like starting a timer or getting the latest weather forecast.

animation showing the tiles experience on Wear OS. User swipes left from the watch face to see the first tile, and continues swiping to see others, including a fitness tile with buttons to initiate a workout, a music tile with chips to navigate to playlists, an alarm tile showing an upcoming alarm, among others.
Tiles carousel on Wear OS

We have built the following components for elements commonly used in tiles:
common tile components. a round icon with a pencil labelled "button". a full width rectangle with rounded corners and text labelled "chip". similar components, one larger and one smaller, labelled "title chip" and "compact chip" respectively. a circle path filled 75% clockwise labelled "circular progress indicator" and finally text labelled "text with recommended typography pre-set"

These components also make it faster to build tiles. For example, creating a button for your tile takes just a few lines of code:

val clickable: Clickable = generateClickable()

val button: Button = Button.Builder(this, clickable)
    .setIconContent("icon_exercise")

    .setContentDescription("Start workout")

    .build()



We have also created some predefined layouts to kickstart your tiles development. These already follow our design guidelines on how your tile layout should be formatted.
A calendar event tile with vertically stacked text details with an "open" action at the bottom, a weather tile showing a cloud icon, the current temperature and the day's high and low in a single row, a step counter tile with a progress indicator encircling the content and a timer tile with 5 buttons for different durations.

For example, we can build this tile using a predefined layout:
Tile with a PrimaryLayout, showing "Primary label text" at the top and "Action" as the primary chip at the bottom. The content slot is a MultiButtonLayout with 2 round icons , each with the plus sign.

val theme = Colors(

    /*primary=*/ 0xFFD0BCFF.toInt(), /*onPrimary=*/ 0xFF381E72.toInt(),

    /*surface=*/ 0xFF202124.toInt(), /*onSurface=*/ 0xFFFFFFFF.toInt()

)

val buttonColors = ButtonColors.secondaryButtonColors(theme)

val chipColors = ChipColors.primaryChipColors(theme)

val timeline = Timeline.fromLayoutElement(
    PrimaryLayout.Builder(deviceParameters)

        .setPrimaryLabelTextContent(

            Text.Builder(this, "1 run this week")

                .setTypography(Typography.TYPOGRAPHY_CAPTION1)

                .setColor(argb(theme.primary))

                .build()

        )

        .setContent(

            MultiButtonLayout.Builder()

                .addButtonContent(

                    Button.Builder(this, clickable)

                        .setIconContent("icon_run")

                        .setButtonColors(buttonColors)

                        .setContentDescription("Run")

                        .build()

                )

                .addButtonContent(

                    Button.Builder(this, clickable)

                        .setIconContent("icon_yoga")

                        .setButtonColors(buttonColors)

                        .setContentDescription("Yoga")

                        .build()

                )
                .addButtonContent(

                    Button.Builder(this, clickable)

                        .setIconContent("icon_cycle")

                        .setButtonColors(buttonColors)

                        .setContentDescription("Cycle")

                        .build()

                )

                .build()

        )

        .setPrimaryChipContent(

            CompactChip.Builder(this, "More", clickable, deviceParameters)

                .setChipColors(chipColors)

                .build()

        )

        .build()

)


What's in the library

This library contains components and layouts that are in-line with Material guidelines and easy to use. The included components are:
  • Button - clickable, circular-shaped object, with either icon, text or image with three predefined sizes.
  • Chip - clickable, stadium-shaped object that can contain an icon, primary and secondary labels, and has fixed height and customizable width.
  • CompactChip & TitleChip - two variations of the standard Chip that have smaller and larger heights, respectively, and can contain one line of text.
  • CircularProgressIndicator - colored arc around the edge of the screen with the given start and end angles, which can describe a full or partial circle with the full progress arc behind it.
  • Text - styled text which uses the recommended Wear Material typography styles.
All these components have their own colors object that can be built with the main Colors class to easily apply the same theme over all components. In addition to colors, there is a Typography class to easily get FontStyle objects using the typography name.

In addition to components, there are recommended tile layouts:
  • PrimaryLayout - a layout which can be customized by adding primary or secondary labels, content in the middle, and a primary chip at the bottom. The main content within this layout could be added as a MultiSlotLayout or MultiButtonLayout object.
  • EdgeContentLayout - a layout for hosting CircularProgressIndicator around the edge with main content inside and primary or secondary label around it.
  • MultiButtonLayout - a layout that can contain between 1 - 7 buttons, arranged in line with the Material guidelines depending on their number.
  • MultiSlotLayout - a row-like style layout with horizontally aligned and spaced slots (for icons or other small content).
All layouts have recommended padding and styles applied that are within Material guidelines.


Tools for tiles

Android Studio Dolphin includes the Direct Surface Launch feature. This lets developers install and launch a tile directly from Android Studio, instead of having to manually add it from the tile selector on the target device. Get started with Direct Surface Launch by creating a new Run Configuration and selecting Wear OS Tile, then choosing the module and TileService class.

Horologist Tiles is also recommended to save time during tile development. This library gives you the ability to preview a tile UI straight from Android Studio, making the write-test loop a lot shorter. Horologist Tiles also includes Kotlin friendly abstractions, like CoroutinesTileService so you can use what you're already familiar with.


Get started with Tiles Material

For a quick start, take a look at the new Tiles codelab, the code sample and the docs.

Please share your feedback on the issue tracker and let us know what you think of Tiles Material!









Build apps for the new Samsung devices

Posted by Diana Wong (Android Product Manager), Kseniia Shumelchyk (Developer Relations Engineer) and Sara Vickerman (Android Developer Marketing)

This week, Samsung launched the latest devices to come to the Android ecosystem at their Galaxy Unpacked event. If you haven’t already, check out their two new foldables, the Galaxy Z Fold4 and Z Flip4, and their new lineup of watches running on Wear OS, the Galaxy Watch5 series. You can learn more about their announcements here.

With the excitement around these new devices, there's never been a better time to invest in making sure your app has an amazing experience for users, on large screens or Wear OS! Here’s what you need to know to get started:

Get your apps ready for foldables, like the Galaxy Z Fold4 and Z Flip4

With their unique foldable experience, the Galaxy Z Flip4 and Z Fold4 are great examples of how Android devices come in all shapes and sizes. The Z Fold4 is the latest in large screen devices, a category that continues to see impressive growth. Active large screen users are approaching 270 million, making it a great time to optimize your apps for tablets, foldables and Chrome OS.

Last year, we launched Android 12L, a feature drop designed to make Android 12 even better on tablets and foldable devices, and Samsung’s Galaxy Z Fold4 will be the first device to run 12L out of the box! Android 12L includes UI updates tailor-made for large screens, improvements to the multitasking experience, and enhancements to compatibility mode so your app looks better out of the box. Since 12L, we also launched Android 13, which includes all these large screen updates and more.

Get started building for foldables by checking out the documentation. The Z Fold4 and Z Flip4 can be used in multiple different folded states, like Samsung’s “flex mode” where you can go hands-free when doing anything from watching a show to taking a photo. To get your app looking great however it’s folded, you can use the Jetpack WindowManager library to make your app fold aware and test your app on foldables. And finally, the large screen app quality guidelines is a comprehensive set of checklists to help make your app the best it can be across an ever expanding ecosystem of large screen devices.

Developers who put in this work are starting to see results; eBay increased their app rating to 4.7 stars on Google Play after optimizing for large screens. Chrome's multitasking usage increased 18x for large screens with 12L.


Build exceptional Wear OS apps

The Wear OS platform expanded this week with the new and improved Galaxy Watch5 series. This lineup of devices builds on Samsung’s commitment to the wearable platform, which we saw last year when they launched Wear OS Powered by Samsung on the Galaxy Watch4 series.

If you’re looking to get started building for the latest Galaxy Watch 5 series, or any other Wear OS device, now is a great time to check out version 1.0 of Compose for Wear OS. This is the first stable release of our modern declarative UI toolkit designed to make building apps for Wear OS easier, faster, and more intuitive. The toolkit brings the best of Jetpack Compose to Wear OS, accelerating the development process so you can create beautiful apps with fewer lines of code.

The 1.0 release streamlines UI development by following the declarative approach and offering powerful Kotlin syntax. It also provides a rich set of UI components optimized for the watch experience and is accompanied by many powerful tools in Android Studio to streamline UI iteration. That’s why Compose for Wear OS is our recommended approach for building user interfaces for Wear OS apps.

We’ve built a set of materials to help you get started with Compose for Wear OS! Check out our curated learning pathway for a step-by-step journey, documentation including a quick start guide, the Compose for Wear OS codelab for hands-on experience, and samples available on Github.

Similarly to Compose for Wear OS, we’re building Wear OS Tile Components to make it faster and easier to build tiles. Tiles provide Wear OS users glanceable access to the information and actions they need in order to get things done quickly and they are one of the most used features on Wear OS. This update brings material components and layouts so you can create Tiles that embrace the latest Material design for Wear OS. Right now this is in beta, but keep a lookout for the launch announcement!

Another launch announcement to watch out for is Android Studio Dolphin, the latest release from Android Studio. Check out these features designed to make wearable app development easier:
  • Updated Wear OS emulator toolbar which now includes buttons and gestures available on Wear OS devices, such as palm and tilting and simulating two physical buttons.
  • Emulator pairing assistant to pair multiple Wear OS devices with a single virtual or physical phone. Android Studio remembers pairings after being closed and allows you to see Wear devices in the Device Manager.
  • Direct surface launch that allows you to create run/debug configurations for Wear OS tiles, watch faces, and complications, and launch them directly from Android Studio.
Between Jetpack Compose, Tile Components and Android Studio Dolphin, we are simplifying Wear OS app development. And, with the addition of the Galaxy Watch5 series to the Wear OS ecosystem, there are even more reasons to build an exceptional Wear OS app.


There’s never been a better time to start optimizing!

Form factors are having a major moment this year and Google is committed to helping you optimize and build across form factors with new content and tools, including sessions and workshops from this year’s Google I/O and new Android Studio features. Plus, we have Material Design guidance for large screens and Wear OS to help you in your optimization journey.

From the Watch5 series to the Z Fold4, Samsung’s Galaxy Unpacked brought us innovations across screen sizes and types. Prepare your app so it looks great across the entire Android device ecosystem!

Build apps for the new Samsung devices

Posted by Diana Wong (Android Product Manager), Kseniia Shumelchyk (Developer Relations Engineer) and Sara Vickerman (Android Developer Marketing)

This week, Samsung launched the latest devices to come to the Android ecosystem at their Galaxy Unpacked event. If you haven’t already, check out their two new foldables, the Galaxy Z Fold4 and Z Flip4, and their new lineup of watches running on Wear OS, the Galaxy Watch5 series. You can learn more about their announcements here.

With the excitement around these new devices, there's never been a better time to invest in making sure your app has an amazing experience for users, on large screens or Wear OS! Here’s what you need to know to get started:

Get your apps ready for foldables, like the Galaxy Z Fold4 and Z Flip4

With their unique foldable experience, the Galaxy Z Flip4 and Z Fold4 are great examples of how Android devices come in all shapes and sizes. The Z Fold4 is the latest in large screen devices, a category that continues to see impressive growth. Active large screen users are approaching 270 million, making it a great time to optimize your apps for tablets, foldables and Chrome OS.

Last year, we launched Android 12L, a feature drop designed to make Android 12 even better on tablets and foldable devices, and Samsung’s Galaxy Z Fold4 will be the first device to run 12L out of the box! Android 12L includes UI updates tailor-made for large screens, improvements to the multitasking experience, and enhancements to compatibility mode so your app looks better out of the box. Since 12L, we also launched Android 13, which includes all these large screen updates and more.

Get started building for foldables by checking out the documentation. The Z Fold4 and Z Flip4 can be used in multiple different folded states, like Samsung’s “flex mode” where you can go hands-free when doing anything from watching a show to taking a photo. To get your app looking great however it’s folded, you can use the Jetpack WindowManager library to make your app fold aware and test your app on foldables. And finally, the large screen app quality guidelines is a comprehensive set of checklists to help make your app the best it can be across an ever expanding ecosystem of large screen devices.

Developers who put in this work are starting to see results; eBay increased their app rating to 4.7 stars on Google Play after optimizing for large screens. Chrome's multitasking usage increased 18x for large screens with 12L.


Build exceptional Wear OS apps

The Wear OS platform expanded this week with the new and improved Galaxy Watch5 series. This lineup of devices builds on Samsung’s commitment to the wearable platform, which we saw last year when they launched Wear OS Powered by Samsung on the Galaxy Watch4 series.

If you’re looking to get started building for the latest Galaxy Watch 5 series, or any other Wear OS device, now is a great time to check out version 1.0 of Compose for Wear OS. This is the first stable release of our modern declarative UI toolkit designed to make building apps for Wear OS easier, faster, and more intuitive. The toolkit brings the best of Jetpack Compose to Wear OS, accelerating the development process so you can create beautiful apps with fewer lines of code.

The 1.0 release streamlines UI development by following the declarative approach and offering powerful Kotlin syntax. It also provides a rich set of UI components optimized for the watch experience and is accompanied by many powerful tools in Android Studio to streamline UI iteration. That’s why Compose for Wear OS is our recommended approach for building user interfaces for Wear OS apps.

We’ve built a set of materials to help you get started with Compose for Wear OS! Check out our curated learning pathway for a step-by-step journey, documentation including a quick start guide, the Compose for Wear OS codelab for hands-on experience, and samples available on Github.

Similarly to Compose for Wear OS, we’re building Wear OS Tile Components to make it faster and easier to build tiles. Tiles provide Wear OS users glanceable access to the information and actions they need in order to get things done quickly and they are one of the most used features on Wear OS. This update brings material components and layouts so you can create Tiles that embrace the latest Material design for Wear OS. Right now this is in beta, but keep a lookout for the launch announcement!

Another launch announcement to watch out for is Android Studio Dolphin, the latest release from Android Studio. Check out these features designed to make wearable app development easier:
  • Updated Wear OS emulator toolbar which now includes buttons and gestures available on Wear OS devices, such as palm and tilting and simulating two physical buttons.
  • Emulator pairing assistant to pair multiple Wear OS devices with a single virtual or physical phone. Android Studio remembers pairings after being closed and allows you to see Wear devices in the Device Manager.
  • Direct surface launch that allows you to create run/debug configurations for Wear OS tiles, watch faces, and complications, and launch them directly from Android Studio.
Between Jetpack Compose, Tile Components and Android Studio Dolphin, we are simplifying Wear OS app development. And, with the addition of the Galaxy Watch5 series to the Wear OS ecosystem, there are even more reasons to build an exceptional Wear OS app.


There’s never been a better time to start optimizing!

Form factors are having a major moment this year and Google is committed to helping you optimize and build across form factors with new content and tools, including sessions and workshops from this year’s Google I/O and new Android Studio features. Plus, we have Material Design guidance for large screens and Wear OS to help you in your optimization journey.

From the Watch5 series to the Z Fold4, Samsung’s Galaxy Unpacked brought us innovations across screen sizes and types. Prepare your app so it looks great across the entire Android device ecosystem!

Compose for Wear OS is now 1.0: time to build wearable apps with Compose!

Posted by Kseniia Shumelchyk, Android Developer Relations Engineer

Today we’re launching version 1.0 of Compose for Wear OS, the first stable release of our modern declarative UI toolkit designed to help developers create beautiful, responsive apps for Google’s smartwatch platform.

Compose for Wear OS was built from the bottom up in Kotlin with assumptions of modern app architecture. It makes building apps for Wear OS easier, faster, and more intuitive by following the declarative approach and offering powerful Kotlin syntax.

The toolkit not only simplifies UI development, but also provides a rich set of UI components optimized for the watch experience with built-in support of Material design for Wear OS, and it’s accompanied by many powerful tools in Android Studio to streamline UI iteration.

What this means

The Compose for Wear OS 1.0 release means that the API is stable and has what you need to build production-ready apps. Moving forward, Compose for Wear OS is our recommended approach for building user interfaces for Wear OS apps.

Your feedback has helped shape the development of Compose for Wear OS; our developer community has been with us each step of the way, engaging with us on Slack and providing feedback on the APIs, components, and tooling. As we are working on bringing new features to future versions of Compose for Wear OS, we will continue to welcome developer feedback and suggestions.

We are also excited to share how developers have already adopted Compose in their Wear OS apps and what they like about it.

What developers are saying

Todoist helps people organize, plan and collaborate on projects. They are one of the first companies to completely rebuild their Wear OS app using Compose and redesign all screens and interactions:

“When the new Wear design language and Compose for Wear OS were announced, we were thrilled. It gave us new motivation and opportunity to invest into the platform.

Todoist application
Relying on Compose for Wear OS has improved both developer and user experience for Todoist:

“Compose for Wear OS helped us tremendously both on the development side and the design side. The guides and documentation made it easy for our product designers to prepare mockups matching the new design language of the platform. And the libraries made it very easy for us to implement these, providing all the necessary widgets and customizations. Swipe to dismiss, TimeText, ScalingLazyList were all components that worked very well out-of-the-box for us, while still allowing us to make a recognizable and distinct app.”


Outdooractive helps people plan routes for hiking, cycling, running, and other outdoor adventures. As wearables are a key aspect of their product strategy, they have been quick to update their offering with an app for the user's wrist.
Outdooractive application
Outdooractive has already embraced Wear OS 3, and by migrating to Compose for Wear OS they aimed for developer-side benefits such as having a modern code base and increased development productivity:

Huge improvement is how lists are created. Thanks to ScalingLazyColumn it is easier (compared to RecyclerView) to create scrolling screens without wasting resources. Availability of standard components like Chip helps saving time by being able to use pre-fabricated design-/view-components. What would have taken us days now takes us hours.

The Outdooractive team also highlighted that Compose for Wear OS usage help them to strive for better app quality:

Improved animations were a nice surprise, allowing smoothly hiding/revealing components by just wrapping components in “AnimatedVisibility” for example, which we used in places where we would normally not have invested any time in implementing animations.


Another developer we’ve been working with, Period Tracker helps keep track of period cycles, ovulation, and the chance of conception.

     
Period Tracker application

They have taken advantage of our UI toolkit to significantly improve user interface and quickly develop new features available exclusively on Wear OS:

“Compose for Wear OS provided us with many kits to help us bring our designs to life. For example, we used Chips to design the main buttons for period recording, water drinking, and taking medication, and it also helped us create a unique look for the latest version of Kegel workout.

Similarly to other developers, Period Tracker noted that Compose for Wear OS helped them to achieve better developer experience and improved collaboration with design and development teams:

“For example, before Chips components were available, we had to use a custom way to load images on buttons which caused a lot of adaptation work. Yes, Compose for Wear OS improved our productivity and made our designers more willing to design a better user experience on wearables.

Check out the in-depth case studies to learn more about how other developers are using Jetpack Compose.

1.0 release

Let’s look into the key features available with 1.0 release:

  • Material: The Compose Material catalog for Wear OS already offers more components than are available with View-based layouts. The components follow material styling and also implement material theming, which allows you to customize the design for your brand.
  • Declarative: Compose for Wear OS leverages Modern Android Development and works seamlessly with other Jetpack libraries. Compose-based UIs in most cases result in less code and accelerate the development process as a whole, read more.
  • Interoperable: If you have an existing Wear OS app with a large View-based codebase, it's possible to gradually adopt Compose for Wear OS by using the Compose Interoperability APIs rather than having to rewrite the whole codebase.
  • Handles different watch shapes: Compose for Wear OS extends the foundation of Compose, adding a DSL for all curved elements to make it easy to develop for all Wear OS device shapes: round, square, or rectangular with minimal code.
  • Performance: Each Compose for Wear OS library ships with its own baseline profiles that are automatically merged and distributed with your app’s APK and are compiled ahead of time on device. In most cases, this achieves app performance for production builds that is on-par with View-based apps. However, it’s important to know how to configure, develop, and test your app’s performance for the best results. Learn more.

Note that using version 1.0 of Compose for Wear OS requires using the version 1.2 of androidx.compose libraries and therefore Kotlin 1.7.0. Read more about Jetpack Compose 1.2 release here.

Tools and libraries

Android Studio

The declarative paradigm shift also alters the development workflow. The Compose tooling available in Android Studio will help you build apps more productively.

Android Studio Dolphin includes a new project template with Compose for Wear OS to help you get started.

The Composable Preview annotation allows you to instantly verify how your app’s layout behaves on different watch shapes and sizes. You can configure the device preview to show different Wear OS device types (round, rectangle, etc):

import androidx.compose.ui.tooling.preview


@Preview(

    device = Devices.WEAR_OS_LARGE_ROUND,

    showSystemUi = true,

    backgroundColor = 0xff000000,

    showBackground = true

)

@Composable

fun PreviewCustomComposable() {

    CustomComposable(...)

}


Starting with Android Studio Electric Eel, Live Edit supports iterative code development for Wear OS, providing quick feedback as you make changes in the editor and immediately reflecting UI in the Preview or running app on the device.

Horologist

Horologist is a group of open-source libraries from Google that supplement Wear OS development, which we announced with the beta release of Compose for Wear OS. Horologist has graduated a number of experimental APIs to stable including TimeText fadeAway modifiers, WearNavScaffold, the Date and Time pickers.

      
Date and Time pickers from Horologist library     

Learning Compose

If you are unfamiliar with using Jetpack Compose, we recommend starting with the tutorial. Many of the development principles there also apply to Compose for Wear OS.

To learn more about Compose for Wear OS check out:

Now that Compose for Wear OS has reached its first stable release, it’s time to create beautiful apps built for the wrist with Compose!

Join the community

Join the discussion in the Kotlin Slack #compose-wear channel to connect with the team and other developers and share what you’re building.

Provide feedback

Please keep providing us feedback on the issue tracker and let us know your experience!

For more information about building apps for Wear OS, check out the developer site.

13 Things to know for Android developers at Google I/O!

Posted by Maru Ahues Bouza, Director of Android Developer Relations

Android I/O updates: Jetpack, Wear OS, etc 

There aren’t many platforms where you can build something and instantly reach billions of people around the world, not only on their phones—but their TVs, cars, tablets, watches, and more. Today, at Google I/O, we covered a number of ways Android helps you make the most of this opportunity, and how Modern Android Development brings as much commonality as possible, to make it faster and easier for you to create experiences that tailor to all the different screens we use in our daily lives.

We’ve rounded up the top 13 things to know for Android developers—from Jetpack Compose to tablets to Wear OS and of course… Android 13! And stick around for Day 2 of Google I/O, when Android’s full track of 26 technical talks and 4 workshops drop. We’re also bringing back the Android fireside Q&A in another episode of #TheAndroidShow; tweet us your questions now using #AskAndroid, and we’ve assembled a team of experts to answer live on-air, May 12 at 12:30PM PT.


MODERN ANDROID DEVELOPMENT

#1: Jetpack Compose Beta 1.2, with support for more advanced use cases

Android’s modern UI toolkit, Jetpack Compose, continues to bring the APIs you need to support more advanced use cases like downloadable fonts, LazyGrids, window insets, nested scrolling interop and more tooling support with features like LiveEdit, Recomposition Debugging and Animation Preview. Check out the blog post for more details.

Jetpack Compose 1.2 Beta  

#2: Android Studio: introducing Live Edit

Get more done faster with Android Studio Dolphin Beta and Electric Eel Canary! Android Studio Dolphin includes new features and improvements for Jetpack Compose and Wear OS development and an updated Logcat experience. Android Studio Electric Eel comes with integrations with the new Google Play SDK Index and Firebase Crashlytics. It also offers a new resizable emulator to test your app on large screens and the new Live Edit feature to immediately deploy code changes made within composable functions. Watch the What’s new in Android Development Tools session and read the Android Studio I/O blog post here.

#3: Baseline Profiles - speed up your app load time!

The speed of your app right after installation can make a big difference on user retention. To improve that experience, we created Baseline Profiles. Baseline Profiles allow apps and libraries to provide the Android runtime with metadata about code path usage, which it uses to prioritize ahead-of-time compilation. We've seen up to 30% faster app startup times thanks to adding baseline profiles alone, no other code changes required! We’re already using baseline profiles within Jetpack: we’ve added baselines to popular libraries like Fragments and Compose – to help provide a better end-user experience. Watch the What’s new in app performance talk, and read the Jetpack blog post here.

Modern Android Development 

BETTER TOGETHER

#4: Going big on Android tablets

Google is all in on tablets. Since last I/O we launched Android 12L, a release focused on large screen optimizations, and Android 13 includes all those improvements and more. We also announced the Pixel tablet, coming next year. With amazing new hardware, an updated operating system & Google apps, improved guidelines and libraries, and exciting changes to the Play store, there has never been a better time to review your apps and get them ready for large screens and Android 13. That’s why at this year’s I/O we have four talks and a workshop to take you from design to implementation for large screens.


#5: Wear OS: Compose + more!

With the latest updates to Wear OS, you can rethink what is possible when developing for wearables. Jetpack Compose for Wear OS is now in beta, so you can create beautiful Wear OS apps with fewer lines of code. Health Services is also now in beta, bringing a ton of innovation to the health and fitness developer community. And last, but certainly not least, we announced the launch of The Google Pixel Watch - coming this Fall - which brings together the best of Fitbit and Wear OS. You can learn more about all the most exciting updates for wearables by watching the Wear OS technical session and reading our Jetpack Compose for Wear OS announcement.

Compose for Wear OS 

#6: Introducing Health Connect

Health Connect is a new platform built in close collaboration between Google and Samsung, that simplifies connectivity between apps making it easier to reach more users with less work, so you can securely access and share user health and fitness data across apps and devices. Today, we’re opening up access to Health Connect through Jetpack Health—read our announcement or watch the I/O session to find out more!

#7: Android for Cars & Android TV OS

Android for Cars and Android TV OS continue to grow in the US and abroad. As more users drive connected or tune-in, we’re introducing new features to make it even easier to develop apps for cars and TV this year. Catch the “What’s new with Android for Cars” and “What's new with Google TV and Android TV” sessions on Day 2 (May 12th) at 9:00 AM PT to learn more.

#8: Add Voice Across Devices

We’re making it easier for users to access your apps via voice across devices with Google Assistant, by expanding developer access to Shortcuts API for Android for Cars, with support for Wear OS apps coming later this year. We’re also making it easier to build those experiences with Smarter Custom Intents, enabling Assistant to better detect broader instances of user queries through ML, without any NLU training heavy lift. Additionally, we’re introducing improvements that drive discovery to your apps via voice on Mobile, first through Brandless Queries, that drive app usage even when the user hasn’t explicitly said your app’s name, and App Install Suggestions that appear if your isn’t installed yet–these are automatically enabled for existing App Actions today.


AND THE LATEST FROM ANDROID, PLAY, AND MORE:

#9: What’s new in Play!

Get the latest updates from Google Play, including new ways Play can help you grow your business. Highlights include the ability to deep-link and create up to 50 custom listings; our LiveOps beta, which will allow more developers to submit content to be considered for featuring on the Play Store; and even more flexibility in selling subscriptions. Learn about these updates and more in our blog post.

#10: Google Play SDK Index

Evaluate if an SDK is right for your app with the new Google Play SDK index. This new public portal lists over 100 of the most widely used commercial SDKs and information like which app permissions the SDK requests, statistics on the apps that use them, and which version of the SDK is most popular. Learn more on our blog post and watch “What’s new in Google Play” and “What’s new in Android development tools” sessions.

#11: Privacy Sandbox on Android

Privacy Sandbox on Android provides a path for new advertising solutions to improve user privacy without putting access to free content and services at risk. We recently released the first Privacy Sandbox on Android Developer Preview so you can get an early look at the SDK Runtime and Topics API. You can conduct preliminary testing of these new technologies, evaluate how you might adopt them for your solutions, and share feedback with us.

#12: The new Google Wallet API

The new Google Wallet gives users fast and secure access to everyday essentials across Android and Wear OS. We’re enhancing the Google Wallet API, previously called Google Pay Passes API, to support generic passes, grouping and mixing passes together, for example grouping an event ticket with a voucher, and launching a new Android SDK which allows you to save passes directly from your app without a backend integration. To learn more, read the full blog post, watch the session, or read the docs at developers.google.com/wallet.

#13: And of course, Android 13!

The second Beta of Android 13 is available today! Get your apps ready for the latest features for privacy and security, like the new notification permission, the privacy-protecting photo picker, and improved permissions for pairing with nearby devices and accessing media files. Enhance your app with features like app-specific language support and themed app icons. Build with modern standards like HDR video and Bluetooth LE Audio. You can get started by enrolling your Pixel device here, or try Android 13 Beta on select phones, tablets, and foldables from our partners - visit developer.android.com/13 to learn more.

That’s just a snapshot of some of the highlights for Android developers at this year’s Google I/O. Be sure to watch the What’s New in Android talk to get the landscape on the full Android technical track at Google I/O, which includes 26 talks and 4 workshops. Enjoy!

Announcing Compose for Wear OS Beta!

Posted by Kseniia Shumelchyk, Developer Relations Engineer, and John Nichol, Tech Lead of Compose for Wear OS

Wear OS watch with blue background 

Today we’re launching the Beta release of Compose for Wear OS, our modern declarative UI toolkit designed to help developers create beautiful user experiences for Wear OS.

Compose for Wear OS adds support for watch optimized components that embrace the latest Material design for Wear OS. The components are built on top of core Compose libraries and the toolkit leverages Modern Android Development, helping accelerate the development process as a whole.

With this Beta release, Compose for Wear OS is feature complete for the 1.0 release coming later this year, and has what you need to build production-ready apps. It also means the API is stable; moving forward we'll focus on performance and polishing existing components for the 1.0 release.


In the Beta

We’ve been hard at work since last I/O to bring the best of Jetpack Compose to Wear OS, engaging with the community via Slack, gathering developer feedback on APIs, components and tooling. As a result, we’ve improved a number of components such as navigation, scaling lazy lists, input and gesture support and much more.

The first Beta release follows 21 alpha releases. The major changes since the Developer Preview announcement include:


🆕 Input components

You asked for user input components, so we’ve added different composables that you can tailor for your watch app:

GIF of picker, slider, and stepper options
  • Picker lets the user select an item from a scrolling list. By default, the list of selectable items is repeated 'infinitely' in both directions, to give the impression of a rotating cylinder seen from the side. Interestingly, Picker uses ScalingLazyColumn implementation underneath and has helped to develop and hone a lot of advanced ScalingLazyColumn features.
  • Slider allows users to make a selection from a range of values and is ideal for adjusting settings like font size or brightness.
  • Stepper is a full-screen control component that allows users to make a selection from a range of values. For example, users can control the volume of their headphones.

🆕 Dialogs

We’ve added full-screen Alert and Confirmation composables that can be used as either navigation destinations or traditional full-screen Dialogs, which will be layered over any other content. Dialog supports swipe-to-dismiss and will reveal the parent content in the background during the swipe gesture.

GIF of watch face showing playlist options

For consistency with Scaffold, a full-screen dialog displays a PositionIndicator and a Vignette.


🆕 Progress Indicator

We added CircularProgressIndicator, a progress indicator optimized for watch screens to display progress by animating an indicator along a circular track in a clockwise direction.

GIF of watch face showing timer

​​There are several options for how CircularProgressIndicator can be used: either to show infinite progress or to express the proportion of completion of an ongoing task. Progress Indicators allow a gap in the circular track which leaves room for other content, for instance TimeText if used in full-screen.


🆕 Page Indicator

To help you implement pagination, the UI toolkit provides a HorizontalPageIndicator component that represents the total number of pages and selected page.

GIF of watch face showing page indicator

Depending on the screen shape, the HorizontalPageIndicator will provide a form factor- specific visual indication of which page is active and how far through the pages it is.


Improvements

  • ScalingLazyColumn: improved the default behavior to be consistent with Material design for Wear OS, such as updating the scaling parameters, default extra padding and taking the size from the size of its contents.
  • Scaffold: added PageIndicator slot to guarantee correct positioning on the round screen.
  • Navigation: ensured feature parity with Compose Navigation and adding support for edge swiping to enable a great experience on full-screen and page scrolling.
  • Curved elements: added CurvedModifiers and a new DSL which enables developers to use concepts that make sense for a curved world like radial, angular, sweep, (anti-) clockwise, inner/outer. CurvedLayout is the bridge between the linear and curved worlds and curvedComposable can be used to introduce traditional composable components when it makes sense to do so.

With these recent additions, the Compose Material catalog for Wear OS now has more components than are available with View-based layouts and provides out-of-the-box implementation of the new Wear OS design guidelines.


Tools

Android Studio Electric Eel provides the latest features for the best experience developing with Compose for Wear OS:

  • Editor and tooling support improving autocomplete and editor actions
  • Wear OS-specific Composable Preview
  • 🆕 Live edit for real-time debugging support
  • 🆕 Compose for Wear OS project template


Horologist

Today we’re also announcing the release of Horologist, a Google open source project which provides a set of Wear libraries that supplement the functionality provided by Compose for Wear OS and other Wear OS APIs.

Gears of a watch

Read about Horology

Horologist offers helpful Compose extensions:

  • Media UI components including playback control and volume screens
  • Material date and time pickers
  • Navigation-aware Scaffold with TimeText and PositionIndicator that stay in sync with scrolling and navigation screen changes.

Horologist will grow to provide developers with additional tools for building great Wear OS apps across different experiences. Check out the Horologist on Github to provide feedback and contribute general functionality that could be useful for Wear developers - and stay tuned for upcoming releases!


Get Started

Many of the development principles for mobile Compose apply to Compose for Wear OS, so if you’re unfamiliar with the UI toolkit start with Jetpack Compose basics.

We’ve prepared a set of materials to help you get started with Compose for Wear OS:

Now that Compose for Wear OS has reached Beta it’s a great time to get started with Compose to quickly bring your app to life or refresh your existing UI. For more information about building apps for Wear OS, check out the developer site.

We’d love to hear from you about your experiences using Compose for Wear OS and what you are able to build! Join the discussion in the Kotlin Slack #compose-wear channel and please keep providing feedback on the issue tracker.

Happy Composing!

Living in a multi-device world with Android

Android has grown into the most popular OS in the world, delivering access, connectivity and information to people everywhere on their smartphones. There are over three billion active monthly Android devices around the world, and in the last year alone, more than a billion new Android phones have been activated. While the phone is still the most popular form of computing, people are adding more connected technologies to their lives like TVs, cars, watches and more.

As we build for a multi-device future, we’re introducing new ways to get more done. Whether it's your phone or your other devices, our updates help them all work better together.

Do more with your Android phone

With Android 13, we’re making updates to privacy and security, personalization and large screen devices. You’ve already seen a preview of this in the Developer Previews and first beta. Across the Android ecosystem, we’re also bringing more ways to keep your conversations private and secure, store your digital identity and get you help in the physical world.

We have been working with carriers and phone makers around the world to upgrade SMS text messaging to a new standard called Rich Communication Services (RCS). With RCS, you can share high-quality photos, see type indicators, message over Wi-Fi and get a better group messaging experience.

This is a huge step forward for the mobile ecosystem and we are really excited about the progress! In fact, Google's Messages app already has half a billion monthly active users with RCS and is growing fast. And, Messages already offers end-to-end encryption for your one-to-one conversations. Later this year, we’ll also be bringing encryption to your group conversations to open beta.

Three messages are shown from a group message between friends who are excited for a baking class they will take together.

Your phone can also help provide secure access to your everyday essentials. Recently, we’ve witnessed the rapid digitization of things like car keys and vaccine records. The new Google Wallet on Android will standardize the way you save and access these important items, plus things like payment cards, transit and event tickets, boarding and loyalty passes and student IDs. We’ll be launching Google Wallet on Wear OS, starting with support for payment cards.

Soon, you’ll be able to save and access hotel keys and office badges from your Android phone. And we know you can’t leave home without your ID, so we're collaborating with states across the U.S. and international partners to bring digital driver's licenses and IDs to Google Wallet later this year.

We’re developing smooth integrations with other Google apps and services while providing granular privacy controls. For example, when you add a transit card to Wallet, your card and balance will automatically show up in Google Maps when you search for directions. If your balance is running low, you can quickly tap and add fare before you arrive at the station.

A user looks at their phone for directions from the San Francisco airport on Google Maps. Since they are looking for public transportation routes, they are prompted on their phone to add fare to their Clipper card, a transit card used throughout the San Francisco Bay Area. With a tap, they add their desired amount of money to the card.

Beyond helping keep your communication and digital identities safe, your devices can be even more essential in critical moments like medical emergencies or natural disasters. In these times, chances are you’ll have either your phone or watch on you. We built critical infrastructure into Android like Emergency Location Services (ELS) to help first responders locate you when you call for help. We recently launched ELS in Bulgaria, Paraguay, Spain and Saudi Arabia, and it is now available to more than one billion people worldwide.

Early Earthquake Warnings are already in place in 25 countries, and this year we’ll launch them in many of the remaining high-risk regions around the world. This year, we’ll also start working with partners to bring Emergency SOS to Wear OS, so you can instantly contact a trusted friend or family member or call emergency services from your watch.

A watch screen depicts the Emergency SOS feature. The watch face has an outline of a red circle that counts down the time before an emergency call is made directly from the watch. In this example 911 is called.

Apps and services that extend beyond the phone

Along with your phone, two of the most important and personal devices in our lives are watches and tablets.

With the launch of our unified platform with Samsung last year, there are now over three times as many active Wear OS devices as there were last year. Later this year, you’ll start to see more devices powered with Wear OS from Samsung, Fossil Group, Montblanc, Mobvoi and others. And for the first time ever, Google Assistant is coming to Samsung Galaxy watches, starting soon with the Watch4 series. The Google Assistant experience for Wear OS has been improved with faster, more natural voice interactions, so you can access useful features like voice-controlled navigation or setting reminders.

We’re also bringing more of your favorite apps to Wear OS. Check out experiences built for your wrist by Spotify, adidas Running, LINE and KakaoTalk. And you’ll see many more from apps like SoundCloud and Deezer later this year.

Various app logos including Spotify, adidas Running, LINE, and more are spread out in a circle outside of a watch.

We’re investing in tablets in a big way and have made updates to the interface in 12L and Android 13 that optimize information for the larger screen. We’ve also introduced new features that help you multitask — for example, tap the toolbar to view the app tray and drag and drop apps to view them in a side by side view.

To support these system-level updates, we’ve also been working to improve the app experiences on Android tablets. Over the next few weeks, we’ll be updating more than 20 Google apps to take full advantage of the extra space including YouTube Music, Google Maps, Messages and more.

A collage of colorful tablets are shown, each tablet with a different app running on its screen such as Google Translate, Google Maps, Google TV, Google Photos, Gmail, and more. The Android logo is in the center of the image with the text “20+ optimized Google tablet apps” written in large lettering.

We’re working with other apps to revamp their experiences this year as well, including TikTok, Zoom, Facebook and many others. You’ll soon be able to easily search for all tablet-optimized apps thanks to updates to Google Play.

The Google Play app is open on a tablet. Apps like TikTok, Instagram, WhatsApp, and Zoom are listed under the “Top Free” section of the app charts, each with an Install button beside it.

Simple ways for your devices to work better together

Getting things done can be much easier if your connected devices all communicate and work together. The openness and flexibility of Android powers phones, watches, tablets, TVs and cars — and it works well with devices like headphones, speakers, laptops and more. Across all these devices, we’re building on our efforts and introducing even more simple and helpful features to move throughout your day.

With Chromecast built-in, you can watch videos, listen to music and more on the device that makes sense depending on where you are and what you’re doing. This means after your daily commute, you can easily play the rest of a movie you were watching on your phone on your TV at home. To help you stay entertained, we’re working to extend casting capabilities to new partners and products, such as Chromebook, or even your car.

An interior of a car with YouTube video being cast from a phone to the in-car display.

Your media should just move with you, so you can automatically switch audio from your headphones while watching a movie on your tablet to your phone when answering an incoming call.

And when you need to get more done across devices, you’ll soon be able to copy a URL or picture from your phone, and paste it on your tablet.

This graphic begins with a user copying an image from the web on their phone. They select the Nearby Share icon and the image from the phone is now in the clipboard of their tablet. The user then clicks paste within a slide in Google Slides on their tablet and the image from the phone appears.

Earlier this year, we previewed multi-device experiences, like expanding Phone Hub on your Chromebook to allow you to access all your phone’s messaging apps. By streaming from your phone to the laptop, you’ll be able to send and reply to messages, view your conversation history and launch your messaging apps from your laptop. We’re also making it easier to set up and pair your devices with the expansion of Fast Pair support to more devices, including built-in support for Matter on Android.

Whether Android brings new possibilities to your phone or the many devices in your life, we’re looking forward to helping you in this multi-device world.

Unpacking 7 features on the latest Samsung Galaxy devices

Today at Galaxy Unpacked, Samsung unveiled the new Galaxy S22 series and Galaxy Tab S8 series and updates coming soon to the Galaxy Watch4 series. Together with Samsung, we’re introducing new features that help you communicate in new ways, get more done and stay entertained with your Galaxy devices.

More ways to connect with live sharing on Google Duo

Video calling with Duo can help you connect with friends and family, no matter how far away. With live sharing support across your favorite apps, you will be able to use Duo on your Galaxy S22 series and Galaxy Tab S8 series to brainstorm ideas with your friends and colleagues through Jamboard, share ideas and images in Samsung Notes and Gallery, watch videos together on YouTube or search for locations on Google Maps.

Preview YouTube videos on Messages by Google

People share YouTube videos on Messages all the time — in fact, they're one of the most-shared types of links on the app overall. In the coming weeks, you’ll be able to see a preview of the video your friends and family share with you right in the conversation, so you can quickly decide whether to watch it now or later. And you can tap again to play the video as well, without ever leaving the chat.

Optimized for accessibility with Voice Access

Voice Access on Android is designed to help people with disabilities navigate and control their device without needing to use their hands. While it’s optimized for people with motor disabilities like ALS, spinal cord injuries or arthritis, it can also be helpful for anyone with a temporary disability like a broken arm, or people whose hands are otherwise occupied. Built into the Galaxy S22 series and Galaxy Tab S8 series, you don’t need to download a separate app, and you can use Voice Access prompts to quickly and easily tap, scroll and navigate your device. Tap, scroll, and browse your device with voice commands. Either set Voice Access to start whenever you use your device, or say, “Hey Google, Voice Access” and the accessibility prompts will help you open apps and manage your device.

Color your world with Material You

Coming with Android 12 out of the box, the Galaxy S22 series and Galaxy Tab S8 series will let you personalize your device by taking advantage of the beautiful Material You design. Change your wallpaper and the look and feel of your entire device, including your notifications, apps and more, will change to match the color palette.

Three phones showing different screens with background color adaptation

Easily set up Google Play apps on your Galaxy Watch4

Setting up a new Galaxy Watch4 has never been easier. Next month, we’ll be improving the setup process so your apps on your Android phone appear as recommended apps on your watch. With a simple tap on your phone, you can install all of your favorite apps from Google Play.

Phone screen showing options to select and sync apps onto your watch

Get help on your watch with Google Assistant

As you move through the day, Google is there to help you get things done across your devices. In the coming months, we’ll bring Google Assistant to Galaxy Watch4. Soon, you can ask Google to help set a timer while cooking, stay on top of your appointments by asking your calendar what’s next, or playing your favorite music – right from your wrist. Google Assistant will be available for download on Google Play and feature a new design with faster than ever response times on your watch. Once activated, just say “Hey Google” to get started.

Listen on the go with YouTube Music Premium

Whether you’re working out or commuting to work, the YouTube Music app on Wear OS provides access to more than 80 million songs and thousands of playlists. Currently, YouTube Premium and YouTube Music Premium subscribers have the ability to download music for ad-free offline listening. Coming soon, we’re adding Wi-Fi and LTE streaming support so subscribers can discover new tunes without their phone nearby. This will be available on Galaxy Watch4 and other Wear OS devices.

We will continue to build on our longstanding partnership to bring helpful Google features to all of your favorite Samsung devices. With the Galaxy S22 series and Galaxy Tab S8 series, you'll receive a four-month trial of YouTube Premium (terms apply[1527fc]) on us. Learn more about the new Samsung Galaxy devices here.

CES 2022: Better together with Android and beyond

Editors note: Google planned to attend CES 2022 but pulled out due to concerns over COVID-19.

The average U.S. household had 25 connected devices in 2021, up from 11 in 2019. If you’re like me, you want to pick and choose the devices that work best for you regardless of brand. You also want to easily set up and move from one device to the next throughout your day, and without having to pull up the same song or task over and over again.

Android was built for everyone, everywhere and to give people more choice in devices, whether it’s based on the design, features or overall value. Over the years, we’ve evolved Android to support more devices in your life such as watches, tablets, TVs and even cars. And beyond Android, our work at Google includes laptops, headphones and speakers, smart home devices and much more.

That’s why we’re building on our efforts and introducing more simple and helpful ways to make your devices, from Android’s ecosystem and beyond, work better together.

Quickly set up and connect your new devices

It can be fun and exciting to get a new device — but that can turn into a headache when you start setting it up. We’re making this process a little less daunting with pairing support for more devices.

Fast Pair has already helped people connect their Android phones with Bluetooth accessories over 100 million times. It enables instant set up and device pairing, bringing up the companion app for installation and transferring your Google credentials. We’re continuing our work with partners to further extend Fast Pair’s functionality beyond audio connectivity with wearables, headphones, speakers and cars and extending it to TVs and smart home devices, so you can instantly start using all the devices in your life.

Starting in a few weeks, when you turn on your Fast Pair-enabled headphones, your Chromebook will automatically detect it and pair with it in a single click, letting you stay focused when studying or working wherever you are. If you get a new Chromebook later this year, you can use your Android phone to quickly set it up and get immediate access to all of the information you’ve already saved, like your Google login and your Wi-Fi password.

Log in credentials transferring from a side by side Android phone to a red Chromebook laptop.

In the coming months, you’ll be able to set up your headphones for when you need to watch quietly with your Google TV or Android TV OS device at home. And with built-in support for Matter on Android, you’ll be able to use Fast Pair to quickly connect new Matter-enabled smart home devices to your network, Google Home and other accompanying apps all in just a few taps.

A phone showing the process of connecting a smart bulb into the Google Home app with Fast Pair for Matter-enabled devices

Lock and unlock your devices

Today, you can already unlock your Chromebook with your Android phone to quickly get right to work. In the coming months, we’ll bring this feature to your paired Wear OS smartwatch so you can instantly unlock and access your Chromebook and Android phone or tablet when you’re close by.

A phone unlocks next to a watch face motioning through a passcode

And with a digital car key, you can now use your compatible Samsung or Pixel phone to lock, unlock and start your supported BMW vehicles from your phone. Starting later this year, on phones with Ultra Wideband (UWB) technology, you won’t even have to take your phone out to use it as a car key. You’ll also be able to securely and remotely share your car key with friends and family if they need to borrow your car. We’re working to bring digital car keys to more Android phones and vehicles later this year.

A phone over an outlined graphic of a car and an unlock motion

Complete tasks and share media across devices

To amplify your visual and audio experiences, your devices should instinctively know which of them you want to use and when. We’re building a technology for Bluetooth-enabled headphones that will enable them to automatically switch the audio to whatever device you’re listening to. So if you’re wearing headphones to watch a movie on your Android tablet and you receive a phone call, the movie will pause and the headphone audio will automatically switch to your Android phone and then switch back to the movie when you’re done. Spatial audio on your headsets will make you feel like you’re really there by adapting the sound based on your head movements, positioning the audio in the space all around you. These features will be available in the next few months on supported headphones.

A video of a movie with dancers playing on a tablet, with a phone on next to it receiving a phone call

We’re also making it easier to move and manage your content across any device. With Chromecast built-in, your Android phone already allows you to share videos to displays and TVs as well as audio content to select speakers from Nest and others. To help you cast music and podcasts you’re listening to from your Android phone to more of your speakers, we’re bringing Chromecast built-in to more brands, starting with all Bose smart speakers and soundbars in the next few months.

A phone above a Bose soundbar showing a cast connection

Whether you’re at home or on the go, we’re also adding features to Phone Hub on Chromebooks later this year that help you accomplish more across your devices. Today, you can use your Chromebook to view and respond to chat notifications, toggle Do Not Disturb, set off the ringtone to find your phone or continue browsing recent Chrome tabs. Later this year, if you’re working on your Chromebook and your Android phone is out of reach (such as charging in a different room), you’ll be able to stay in touch by accessing chat apps from your phone directly to your Chromebook –without needing to install them again on your Chromebook. We’re also excited to add Camera Roll to the Phone Hub, which makes access to your most recent photos and videos as easy as one click.

A phone receiving a text message, with the message appearing on a red laptop for responding

Today, you can already use your voice while driving to close the garage door, turn off the kitchen lights, turn down the thermostat and check if you locked the front door. You’ll soon be able to ask Google for help even before you leave the front door. With remote actions, you can use your voice to warm up and cool down your car, lock and unlock and get information (like how much battery you have left) on all Assistant-enabled devices. These capabilities are coming first to vehicles from Volvo Cars in the coming months, with more to follow.

Do more with Android and Windows PCs

For the first time with Android, we’re also focused on building for other platforms, like Windows, whether it's in gaming, productivity or other areas. For example, by connecting your Android phone to your Windows PC with Fast Pair, you’ll be able to quickly set up Bluetooth accessories, sync text messages and share files with Nearby Share. We’re working with Acer, HP and Intel to bring these experiences to select Windows PCs first later this year.

An HP Windows PC laptop next to a phone showing Nearby Share as a feature for sending files

These features will be rolling out throughout the year. Moving forward, you’ll continue to see us invest in more helpful ways for your devices to work better together.

Develop watch faces with the stable Jetpack Watch Face library

Posted by Alex Vanyo, Developer Relations Engineer

Illustration of tan hand showing a watch

Watch faces are one of the most visible ways that people express themselves on their smartwatches, and they’re one of the best ways to display your brand to your users.

Watch Face Studio from Samsung is a great tool for creating watch faces without writing any code. For developers who want more fine-tuned control, we've recently launched the Jetpack Watch Face library written from the ground up in Kotlin.

The stable release of the Jetpack Watch Face library includes all functionality from the Wearable Support Library and many new features that make it easier to support customization on the smartwatch and on the system companion app on mobile, including:

  • Watch face styling which persists across both the watch and phone (with no need for your own database or companion app).
  • Support for a WYSIWYG watch face configuration UI on the phone.
  • Smaller, separate libraries (that only include what you need).
  • Battery improvements through encouraging good battery usage patterns out of the box, such as automatically reducing the interactive frame rate when battery is low.
  • New screenshot APIs so users can see previews of their watch face changes in real time on both the watch and phone.

If you are still using the Wearable Support Library, we strongly encourage migrating to the new Jetpack libraries to take advantage of the new APIs and upcoming features and bug fixes.


Below is an example of configuring a watch face from the phone with no code written on or for the phone.

GIF showing how to edit a watch face using the Galaxy Wearable mobile companion app

Editing a watch face using the Galaxy Wearable mobile companion app


If you use the Jetpack Watch Face library to save your watch face configuration options, the values are synced with the mobile companion app. That is, all the cross-device communication is handled for you.

The mobile app will automatically present those options to the user in a simple, intuitive user interface where they change them to whatever works best for their style. It also includes previews that update in real time.

Let’s dive into the API with an overview of the most important components for creating a custom watch face!


WatchFaceService

A subclass of WatchFaceService forms the entry point of any Jetpack watch face. Implementing a WatchFaceService requires creating 3 objects: A UserStyleSchema, a ComplicationSlotsManager, and a WatchFace:

Diagram showing the 3 main parts of a WatchFaceService

Diagram showing the 3 main parts of a WatchFaceService

These 3 objects are specified by overriding 3 abstract methods from WatchFaceService:

class CustomWatchFaceService : WatchFaceService() {

    /**
     * The specification of settings the watch face supports.
     * This is similar to a database schema.
     */
    override fun createUserStyleSchema(): UserStyleSchema = // ...

    /**
     * The complication slot configuration for the watchface.
     */
    override fun createComplicationSlotsManager(
        currentUserStyleRepository: CurrentUserStyleRepository
    ): ComplicationSlotsManager = // ...

    /**
     * The watch face itself, which includes the renderer for drawing.
     */ 
    override suspend fun createWatchFace(
        surfaceHolder: SurfaceHolder,
        watchState: WatchState,
        complicationSlotsManager: ComplicationSlotsManager,
        currentUserStyleRepository: CurrentUserStyleRepository
    ): WatchFace = // ...

}

Let’s take a more detailed look at each one of these in turn, and some of the other classes that the library creates on your behalf.


UserStyleSchema

The UserStyleSchema defines the primary information source for a Jetpack watch face. The UserStyleSchema should contain a list of all customization settings available to the user, as well as information about what those options do and what the default option is. These settings can be boolean flags, lists, ranges, and more.

By providing this schema, the library will automatically keep track of changes to settings by the user, either through the mobile companion app on a connected phone or via changes made on the smartwatch in a custom editor activity.

    override fun createUserStyleSchema(): UserStyleSchema =
        UserStyleSchema(
            listOf(
                // Allows user to change the color styles of the watch face
                UserStyleSetting.ListUserStyleSetting(
                    UserStyleSetting.Id(COLOR_STYLE_SETTING),
                    // ...
                ),
                // Allows user to toggle on/off the hour pips (dashes around the outer edge of the watch
                UserStyleSetting.BooleanUserStyleSetting(
                    UserStyleSetting.Id(DRAW_HOUR_PIPS_STYLE_SETTING),
                    // ...
                ),
                // Allows user to change the length of the minute hand
                UserStyleSetting.DoubleRangeUserStyleSetting(
                    UserStyleSetting.Id(WATCH_HAND_LENGTH_STYLE_SETTING),
                    // ...
                )
            )
        )

CurrentUserStyleRepository

The current user style can be observed via the ​​CurrentUserStyleRepository, which is created by the library based on the UserStyleSchema.

It gives you a UserStyle which is just a Map with keys based on the settings defined in the schema:

Map<UserStyleSetting, UserStyleSetting.Option>

As the user’s preferences change, a MutableStateFlow of UserStyle will emit the latest selected options for all of the settings defined in the UserStyleSchema.

currentUserStyleRepository.userStyle.collect { newUserStyle ->
    // Update configuration based on user style
}

CurrentUserStyleRepository

Complications allow a watch face to display additional information from other apps on the watch, such as events, health data, or the day.

The ComplicationSlotsManager defines how many complications a watch face supports, and where they are positioned on the screen. To support changing the location or number of complications, the ComplicationSlotsManager also uses the ​​CurrentUserStyleRepository.

    override fun createComplicationSlotsManager(
        currentUserStyleRepository: CurrentUserStyleRepository
    ): ComplicationSlotsManager {
        val defaultCanvasComplicationFactory =
            CanvasComplicationFactory { watchState, listener ->
                // ...
            }
    
        val leftComplicationSlot = ComplicationSlot.createRoundRectComplicationSlotBuilder(
            id = 100,
            canvasComplicationFactory = defaultCanvasComplicationFactory,
            // ...
        )
            .setDefaultDataSourceType(ComplicationType.SHORT_TEXT)
            .build()
    
        val rightComplicationSlot = ComplicationSlot.createRoundRectComplicationSlotBuilder(
            id = 101,
            canvasComplicationFactory = defaultCanvasComplicationFactory,
            // ...
        )
            .setDefaultDataSourceType(ComplicationType.SHORT_TEXT)
            .build()

        return ComplicationSlotsManager(
            listOf(leftComplicationSlot, rightComplicationSlot),
            currentUserStyleRepository
        )
    }

WatchFace

The WatchFace describes the type of watch face and how to draw it.

A WatchFace can be specified as digital or analog and can optionally have a tap listener for when the user taps on the watch face.

Most importantly, a WatchFace specifies a Renderer, which actually renders the watch face:

    override suspend fun createWatchFace(
        surfaceHolder: SurfaceHolder,
        watchState: WatchState,
        complicationSlotsManager: ComplicationSlotsManager,
        currentUserStyleRepository: CurrentUserStyleRepository
    ): WatchFace = WatchFace(
        watchFaceType = WatchFaceType.ANALOG,
        renderer = // ...
    )

Renderer

The prettiest part of a watch face! Every watch face will create a custom subclass of a renderer that implements everything needed to actually draw the watch face to a canvas.

The renderer is in charge of combining the UserStyle (the map from ​​CurrentUserStyleRepository), the complication information from ComplicationSlotsManager, the current time, and other state information to render the watch face.

class CustomCanvasRenderer(
    private val context: Context,
    surfaceHolder: SurfaceHolder,
    watchState: WatchState,
    private val complicationSlotsManager: ComplicationSlotsManager,
    currentUserStyleRepository: CurrentUserStyleRepository,
    canvasType: Int
) : Renderer.CanvasRenderer(
    surfaceHolder = surfaceHolder,
    currentUserStyleRepository = currentUserStyleRepository,
    watchState = watchState,
    canvasType = canvasType,
    interactiveDrawModeUpdateDelayMillis = 16L
) {
    override fun render(canvas: Canvas, bounds: Rect, zonedDateTime: ZonedDateTime) {
        // Draw into the canvas!
    }

    override fun renderHighlightLayer(canvas: Canvas, bounds: Rect, zonedDateTime: ZonedDateTime) {
        // Draw into the canvas!
    }
}

EditorSession

In addition to the system WYSIWYG editor on the phone, we strongly encourage supporting configuration on the smartwatch to allow the user to customize their watch face without requiring a companion device.

To support this, a watch face can provide a configuration Activity and allow the user to change settings using an EditorSession returned from EditorSession.createOnWatchEditorSession. As the user makes changes, calling EditorSession.renderWatchFaceToBitmap provides a live preview of the watch face in the editor Activity.

To see how the whole puzzle fits together to tell the time, check out the watchface sample on GitHub. To learn more about developing for Wear OS, check out the developer website.