Tag Archives: Wear OS

Creating custom Tiles on Wear OS by Google with the Jetpack Tiles library

Posted by Jolanda Verhoef, Developer Relations Engineer

Wear OS header

We introduced Tiles in 2019, and since then, Tiles have become one of the most helpful and useful features on Wear OS by Google smartwatches. They are fast to access, convenient, and designed to provide users with swipeable access to the things they need to know and get done right from their wrist. This also gives users control over what information and actions they want to see.

Today, we're excited to announce that the Jetpack Tiles library is in alpha. This library enables developers to create custom Tiles on Wear OS smartwatches. These custom Tiles will become available to users later this Spring when we roll out the corresponding Wear OS platform update.

Wear OS interface

Tiles can be designed for many use cases, like tracking the user’s daily activity progress, quick-starting a workout, starting a recently played song, or sending a message to a favorite contact. While apps can be immersive, Tiles are fast-loading and focus on the user's immediate needs. If the user would like more information, Tiles can be tapped to open a related app on the watch or phone for a deeper experience.

Tile designs from Figma

Getting started

Tiles are built using Android Studio, as part of your Wear OS application. Start by adding the Wear OS Tiles dependencies:

dependencies {
  implementation "androidx.wear:wear-tiles:1.0.0-alpha01"
  debugImplementation "androidx.wear:wear-tiles-renderer:1.0.0-alpha01"
}

The first dependency includes the library you need to create a Tile, while the second dependency lets you preview the Tile in an activity.

Next, provide the information to render the Tile using the TileProviderService:

class MyTileService : TileProviderService() {
  override fun onTileRequest(requestParams: RequestReaders.TileRequest) =
    Futures.immediateFuture(Tile.builder()
      .setResourcesVersion("1")
      .setTimeline(Timeline.builder().addTimelineEntry(
         // For more information about timelines, see the docs
         TimelineEntry.builder().setLayout(
           Layout.builder().setRoot(
             Text.builder().setText("Hello world!")
           )
         )
      )
    ).build())

  override fun onResourcesRequest(requestParams: ResourcesRequest) =
    Futures.immediateFuture(Resources.builder()
      .setVersion("1")
      .build()
    )
}

There are two important parts to this code:

  • onTileRequest() creates your Tile layout. This is where most of your code goes. You can use multiple TimelineEntry instances to render different layouts for different points in time.
  • onResourcesRequest() passes any resources needed to render your Tile. If you decide to add any graphics, include them here.

Create a simple activity to preview your Tile. Add this activity in src/debug instead of src/main, as this activity is only used for debugging/previewing purposes.

class MainActivity : ComponentActivity() {
  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)
    val rootLayout = findViewById<FrameLayout>(R.id.tile_container)
    TileManager(
      context = this,
      component = ComponentName(this, MyTileService::class.java),
      parentView = rootLayout
    ).create()
  }
}

Now you’re ready to publish your Tile. For more information on how to do that, and to learn more about Tiles, read our new guide and take a look at our sample Tiles to see them in action.

The Jetpack Tiles library is in alpha, and we want your feedback to help us improve the API. Happy coding!

11 Weeks of Android: Beyond phones

Posted by Product Leads for Android TV, Android for cars, Wear OS, and Chrome OS

Android

This blog post is part of a weekly series for #11WeeksOfAndroid. Each week we’re diving into a key area of Android so you don’t miss anything. This week, we spotlighted Android Beyond Phones; here’s a look at what you should know.

With Android, people can experience the apps and services that they love across many devices & surfaces. Beyond phones, Android offers distinct yet familiar experiences on devices of all shapes and sizes, ranging from the smallest smartwatch screens, to larger displays on foldables and Chromebooks, to in-car entertainment systems, and all the way up to the largest television screens. For the past 4 days, we featured a daily deep dive into each of these exciting form factors that are providing developers with new and growing ways to engage people. Read on for a recap.

Android TV

We kicked off the week with Android TV, which is now partnering with 7 of the top 10 OEMs and over 160 television operators across the globe. The Android TV team highlighted 6 upcoming launches, like instant app trials right from Google Play and an updated Gboard, to help developers acquire more users, more easily monetize, and build even more engaging experiences. Then, new resources were published to help developers build their first Android TV app, or even go deep on new integrations like Cast Connect and frictionless subscriptions. If you’re excited about developing for TV, pick up an ADT-3, learn the latest from the training pathway, and bring your Android app to the biggest screen in the home!

Android for Cars

We shared new ways to reach more drivers on Android for cars. Android Auto, which allows you to connect your phone to your car display, is currently available with nearly every major car manufacturer and is on track to reach 100 million cars. Soon, new app categories including navigation, parking, and electric vehicle charging will be available and the experience for Android Auto users will become even more seamless as car manufacturers continue to add support for wireless connectivity. We also highlighted the launch of the first car powered by Android Automotive OS with Google apps and services built in — the Polestar 2. As more manufacturers ship cars with this embedded functionality, we’re making it even easier for developers to build media apps on Android Automotive OS with updated documentation and emulators. Get started today to bring your app to cars!

Large Screens

We covered large screens starting with the announcement of ChromeOS.dev — a dedicated resource for technical developers, designers, product managers, and business leaders. We’ve showcased our growth in device sales in Chrome OS, seeing Chromebook unit sales grew 127% year over year between March and June this year1, as well as some of the new features coming, such as customizable Linux Terminal and Android Emulator support. We’ve also continued to see growth in apps optimized for larger screen experiences, with over 1 million apps optimized for tablets and large screens available in the Google Play store. To help you develop the best-in-class apps for Chrome OS, foldables and tablets, we are continuing to release new features and updates. We released new design recommendations for your app as well as a few updates made in Android Studio. Check out the new sessions and some of the resurfaced content to learn more about bringing the best experiences to your users on these large-screen devices.

Wear OS

To round out the week, we talked about Wear OS where we are investing in the fundamentals with a focus on performance and faster app startup times, which you’ll see in the latest platform release coming in the fall. Wear OS will be launching updates to cornerstone features like Weather in the coming months, and is investing in helpful experiences, such as our recent hand-wash timer to help people maintain hand-hygiene in the Covid-19 pandemic. The team is working hard to bring the best of Android 11 to Wear OS.

Learning paths

Are you building your apps with different screen sizes and form factors in mind? Check out all the resources for Wear OS and Android for cars, and if you’re looking for an easy way to pick up the highlights of this week for Android TV and large screens, consider completing the pathway for each. These include codelabs, videos, articles and blog posts. A virtual badge is awarded to each user who passes the quiz.

We hope that you found the Android Beyond Phones week useful, and we're excited to see all the great experiences that you'll build on these platforms!

Resources

You can find the entire playlist of #11WeeksOfAndroid video content here, and learn more about each week here. We’ll continue to spotlight new areas each week, so keep an eye out and follow us on Twitter and YouTube. Thanks so much for letting us be a part of this experience with you!

Sources:
1 The NPD Group, Inc., U.S. Retail Tracking Service, Notebook Computers, based on unit sales, April–June 2020 and March–June 2020​.

11 Weeks of Android: Beyond phones

Posted by Product Leads for Android TV, Android for cars, Wear OS, and Chrome OS

Android

This blog post is part of a weekly series for #11WeeksOfAndroid. Each week we’re diving into a key area of Android so you don’t miss anything. This week, we spotlighted Android Beyond Phones; here’s a look at what you should know.

With Android, people can experience the apps and services that they love across many devices & surfaces. Beyond phones, Android offers distinct yet familiar experiences on devices of all shapes and sizes, ranging from the smallest smartwatch screens, to larger displays on foldables and Chromebooks, to in-car entertainment systems, and all the way up to the largest television screens. For the past 4 days, we featured a daily deep dive into each of these exciting form factors that are providing developers with new and growing ways to engage people. Read on for a recap.

Android TV

We kicked off the week with Android TV, which is now partnering with 7 of the top 10 OEMs and over 160 television operators across the globe. The Android TV team highlighted 6 upcoming launches, like instant app trials right from Google Play and an updated Gboard, to help developers acquire more users, more easily monetize, and build even more engaging experiences. Then, new resources were published to help developers build their first Android TV app, or even go deep on new integrations like Cast Connect and frictionless subscriptions. If you’re excited about developing for TV, pick up an ADT-3, learn the latest from the training pathway, and bring your Android app to the biggest screen in the home!

Android for Cars

We shared new ways to reach more drivers on Android for cars. Android Auto, which allows you to connect your phone to your car display, is currently available with nearly every major car manufacturer and is on track to reach 100 million cars. Soon, new app categories including navigation, parking, and electric vehicle charging will be available and the experience for Android Auto users will become even more seamless as car manufacturers continue to add support for wireless connectivity. We also highlighted the launch of the first car powered by Android Automotive OS with Google apps and services built in — the Polestar 2. As more manufacturers ship cars with this embedded functionality, we’re making it even easier for developers to build media apps on Android Automotive OS with updated documentation and emulators. Get started today to bring your app to cars!

Large Screens

We covered large screens starting with the announcement of ChromeOS.dev — a dedicated resource for technical developers, designers, product managers, and business leaders. We’ve showcased our growth in device sales in Chrome OS, seeing Chromebook unit sales grew 127% year over year between March and June this year1, as well as some of the new features coming, such as customizable Linux Terminal and Android Emulator support. We’ve also continued to see growth in apps optimized for larger screen experiences, with over 1 million apps optimized for tablets and large screens available in the Google Play store. To help you develop the best-in-class apps for Chrome OS, foldables and tablets, we are continuing to release new features and updates. We released new design recommendations for your app as well as a few updates made in Android Studio. Check out the new sessions and some of the resurfaced content to learn more about bringing the best experiences to your users on these large-screen devices.

Wear OS

To round out the week, we talked about Wear OS where we are investing in the fundamentals with a focus on performance and faster app startup times, which you’ll see in the latest platform release coming in the fall. Wear OS will be launching updates to cornerstone features like Weather in the coming months, and is investing in helpful experiences, such as our recent hand-wash timer to help people maintain hand-hygiene in the Covid-19 pandemic. The team is working hard to bring the best of Android 11 to Wear OS.

Learning paths

Are you building your apps with different screen sizes and form factors in mind? Check out all the resources for Wear OS and Android for cars, and if you’re looking for an easy way to pick up the highlights of this week for Android TV and large screens, consider completing the pathway for each. These include codelabs, videos, articles and blog posts. A virtual badge is awarded to each user who passes the quiz.

We hope that you found the Android Beyond Phones week useful, and we're excited to see all the great experiences that you'll build on these platforms!

Resources

You can find the entire playlist of #11WeeksOfAndroid video content here, and learn more about each week here. We’ll continue to spotlight new areas each week, so keep an eye out and follow us on Twitter and YouTube. Thanks so much for letting us be a part of this experience with you!

Sources:
1 The NPD Group, Inc., U.S. Retail Tracking Service, Notebook Computers, based on unit sales, April–June 2020 and March–June 2020​.

What’s happening in Wear OS by Google

Posted by Karen Ng, Director of Product and Robert Simpson, Product Manager

This blog post is part of a weekly series for #11WeeksOfAndroid. For each week, we’re diving into a key area and this week we’re focusing on Android Beyond Phones. Today, we’ll share what’s happening with Wear OS by Google.

Wearable technologies help people lead healthier lives and connect with important, timely information. Today, we're sharing our areas of investment focusing on the fundamentals, bringing even more helpful experiences to more watches, and giving users more choice in a device ecosystem.

Focusing on fundamentals

Wearables are designed to instantly connect people with what's important throughout the day. That's why we're focused on fundamentals like performance and power.

In the next OTA update coming in the fall, we’re improving performance by making it faster to access your info and start your apps. We’re simplifying the pairing process to make onboarding easier. You’ll see improvements to our SysUI for more intuitive controls for managing different watch modes and workouts. And with CPU core improvements, you’ll also see up to a 20% speed improvement in startup time for your apps.

Finally, we continue to support advancements in technology to bring new functionality, such as LTE, and expand levels of performance with the new Qualcomm® Snapdragon Wear™ 4100 and 4100+ platforms. We are excited by the kinds of wearable experiences that can be enabled in the future.

More helpful experiences

Wearables showcase important information at a glance. Some of the most used features of Wear OS by Google are hands-free timers and tracking fitness metrics. In response to COVID-19, we built a handwashing timer that helps ensure users practice good hygiene.

And later this year, you’ll see a beautiful new weather experience for Wear OS by Google. It aims to be easier to read while on the go, with an hourly breakdown of today’s weather to help you plan ahead and provide information about important weather alerts in your area.

Wearable OS image Wearable OS image Wearable OS image

We’re always imagining new ways wearables can help people stay healthy, present and connected. Stay tuned for more in 2021!

More choice than ever

We’re excited to welcome new watch OEMs to the Wear OS by Google family -- Oppo, Suunto, and Xiaomi. This means new watches that fit your style and needs -- such as the Suunto 7 with rich sports capabilities, or the new LTE watches from Oppo that will keep you connected on the go.

Bringing the best of Android to wearables

We’re also working to bring the best of Android 11 to wearables. Many of the things you’ve seen in modern Android development -- from Android Studio, a great language with Kotlin, and Jetpack libraries to make common tasks easier will be part of what you can expect as a developer building wearable apps. We’ve just released a release candidate for androidx.wear 1.1.0, and would love feedback on things you’d like to see as you get started building a wearable app.

We can’t wait to see what helpful experiences you’ll build!

Wear OS by Google: final API 28 emulator with new redesigned UI

Posted by Hoi Lam, Lead Developer Advocate

Today, we are launching the final API 28 emulator image for developers. This image will also contain the UI redesign we announced in August. You should verify that your app's notification works well with the new notification steam, and that your apps work well against changes previously announced for API 28.

What's new in API 28?

Here are the highlights of the API 28 emulator:

  • New notification stream - You should make sure that your notifications are branded correctly, using color, and that the notification is sufficiently concise to fit into the new layout. Custom notification layout is no longer supported.
  • App Standby Buckets - Wear OS prioritizes app requests for resources based on how recent and how frequently the apps have been used. Developers are advised to follow best practices to ensure that their app behaves well, whichever bucket the apps are in.
  • User input and data privacy - To enhance user privacy, API 28 introduced new changes which limit background apps' access to device sensors. Depending on app requirements, developers may need to use a foreground service to enable continual access to sensor data.

Please note that changes related to the new notification stream are being rolled out to devices supporting API 25 and up. You can test how your notification will behave now, before roll-out is complete, by using the API 28 emulator image.

Keep your feedback coming

Just because we are now in release build does not mean that our work stops here. Please continue to submit all bug / enhancement requests via the Wear OS by Google issue tracker.

Finally, we are grateful for all of your valuable feedback during the developer preview. It played an important role in our decision making process - especially concerning App Standby Buckets. Thank you!

Make the most of Notifications with the redesigned Wear OS by Google

Posted by Hoi Lam, Lead Developer Advocate, Wear OS by Google

Today we announced that we are evolving the design of Wear OS by Google to help you get the most out of your time - providing quicker access to your information and notifications. Notifications can come from the automatic bridging of the phone's notification or be generated by a local Wear app running on the watch. Whether you are a phone developer, a Wear app developer, or both, there are a few things you will need to know about the new notification stream.

The new notification stream

Until now, each notification took up the entire screen in Wear OS. Although this provided more space to include things like inline action, it also meant it took a long time for the user to go through all their notifications. The new notification stream is more compact, and can display multiple notifications on the same screen. This means users can process their notification streams more quickly.

What this means for developers

  • Concise notification content is even more important. The new unexpanded notification on Wear will show up to three lines of text. Because this is already more information than a single line unexpanded notification on the user's phone, if your notification works on the phone unexpanded, it should be fine on Wear.
  • Brand notification with color. The default title and icon color for notification is white. Developers can now convey their brand identities by customizing the color of the title and icon tint using setColor.
  • Custom notification layout will no longer be supported. Previously developers used setDisplayIntent to inflate a custom activity inside the notification stream. We have found that the custom layout often does not take into account of the device form factor, and is difficult to keep up to date as Wear OS's notification experience evolves. As a result, we will no longer support this in notifications.
  • Inline action is being reviewed. To save space, the new layout no longer display inline action in the stream and setHintDisplayActionInline will be ignored. Users can continue to access notification actions including inline action when they tap to expand the notification. Our design team is reviewing whether we should include inline action in a future release. As a result, before a decision is made, we are not deprecating the related APIs. We will keep the developer community updated in due course.

As always, the current best practices for notification still apply. In particular, for messaging apps developers, we strongly encourage the use of MessagingStyle notification and enabling on-device Smart Reply through setAllowGeneratedReplies.

We will start rolling these changes out in the next month, so watch for updates on your Wear OS by Google smartwatch!

Updating Wear OS Google Play Store policy to increase app quality

Posted by Hoi Lam, Lead Developer Advocate, Wear OS by Google

Today we are announcing a new initiative to improve Wear app quality and their presentation in the Google Play Store. The Wear app review process, which has been in place since the launch of Android Wear 2.0, is currently optional. It will become mandatory for apps to be listed on the Wear OS by Google version of the Google Play Store from the following dates:

  • New Wear apps: 1 October 2018
  • Existing Wear apps: 4 March 2019.

The review process for mobile apps remains unchanged, and is independent of the Wear app review. Mobile app updates will not be blocked if they fail the Wear app review.

We hope this lightweight app review process will improve the quality of Wear app experiences across the wide range of devices available to your users. In addition, since screenshots are required for the Wear app review, this will improve the discovery and presentation of your Wear apps in the Google Play Store.

See a comprehensive list of review criteria here. The following are common issues we see during Wear app reviews:

  • Support for different screen types - Wear OS by Google is available in both round and square screens, and some round devices also have a chin. Developers are advised to test on all screen types. If a physical device is unavailable, please use the Wear OS by Google emulator.
  • Wear OS by Google app screenshot - To pass the review, the app needs to have at least one Wear OS app screenshot. To keep pre-release Wear apps private, the Google Play Store will not show the Wear screenshots unless the Wear App is in production or open testing. Currently, the Google Play Store only supports uploading one set of screenshots across all production and test versions. For existing Wear apps, we recommend developers keeping their production Wear app screenshots unchanged when uploading new open test or closed test Wear apps.

Opting out of app review for early prototypes

We understand that some developers need to experiment with their Wear apps in the early stages of app development, and a Wear app review at this stage might not be appropriate. In this case, developers have two options:

Please note that the open test and closed test channels will be subject to Wear app review to help front-load the quality assurance process and to avoid leaving reviews to the last minute.

Thank you for your continuing support of Wear OS by Google.

Wear OS developer preview reenabling alarms and jobs for background apps

Posted by Hoi Lam, Lead Developer Advocate, Wear OS by Google

From the outset of the Wear OS by Google developer preview, battery life has been a major focus area. When we talked to the developer community, the update that attracted the most feedback was the disabling of alarms and jobs for background apps. After listening to developer feedback and reviewing the battery statistics, we are reversing this change. This should be reflected in all connected Wear OS preview devices, so there is no need to reflash your device.

App Standby Buckets

The decision came as we reviewed the feedback and saw that a strict on/off setting prevents reasonable usage and promotes anti-patterns. Going forward, we plan to leverage the App Standby Buckets feature in Android P to fine-tune a suitable setting for Wear OS devices. The exact setting for alarms and jobs for background apps is still being iterated on. Developers are advised to follow the best practices to make sure their apps behave well, whichever bucket the apps are in.

Input and data privacy in background apps

Another area that developers should pay attention to is the strengthening of input and data privacy for background apps in Android P. Depending on an app's requirements, developers may need to use a foreground service to enable access to the device sensor throughout the day.

Please give us your feedback

We expect to provide more updates to this preview before the final production release. Please submit any bugs you find via the Wear OS by Google issue tracker. The earlier you submit them, the higher the likelihood that we can include the fixes in the final release.

Wear OS by Google developer preview

Posted by Hoi Lam, Lead Developer Advocate, Wear OS by Google

Today we launched the Wear OS by Google developer preview and brought Android P platform features to wearables. The developer preview includes updated system images on the official Android Emulator and a downloadable system image for the Huawei Watch 2 Bluetooth or Huawei Watch 2 Classic Bluetooth. This initial release is intended for developers only and is not for daily or consumer use. Therefore, it is only available via manual download and flash. Please refer to the release notes for known issues before downloading and flashing your device.

In this release, we would like to highlight the following features that developers should pay attention to:

  • Restriction related to non-SDK methods and fields: To improve app compatibility, Android P has started the process of restricting access to non-SDK methods and fields. Developers should make plans to migrate away from these. If there is no public equivalent for your use case, please let us know.
  • Dark UI system theme: To enhance glanceability, Wear OS has switched to a UI theme with a darker / black background for the notifications stream and system launcher since the start of the year. This is now also the default for the system theme and should improve the glanceability for wear apps. Developers should check the accessibility of their app's UI after this change.
  • Limited background activity: To improve power, apps will no longer be allowed to run in the background unless the watch is on the charger. Developers should note that Wear OS is going further with Android's app standby feature than some other form factors. Exceptions to this include watch faces and complications that the user currently has selected. This feature will be rolled out gradually in the developer preview, so you may not see it immediately on your device, but should build your apps accordingly by removing background services.
  • Turning off radios when off body: To improve power, bluetooth, WiFi, and cellular radios will be turned off when the watch is detected to be off body for an extended period of time. Again, this feature will be rolled out gradually so you may not initially see it on your device. If this feature causes challenges in your development process, you can disable the feature via adb; please follow the instructions in the release notes.
  • WiFi off when BT is disconnected: To improve power, the device will no longer automatically connect to wifi when disconnected from bluetooth. Exceptions include if an app is requesting a high bandwidth network or if the watch is on the charger. This feature will be rolled out gradually so you may not initially see it on your device.

Please give us your feedback

We expect to provide several updates to this preview before the final production release. Please submit any bugs you find via the Wear OS by Google issue tracker. The earlier you submit them, the higher the likelihood that we can include the fixes in the final release.