Author Archives: Android Developers

Android Studio Arctic Fox (2020.3.1) Beta

Posted by Paris Hsu, Product & Design, Android

Android Studio Arctic Fox splash screen

Android Studio Arctic Fox splash screen

Note: As we announced late last year, we've changed our version numbering scheme to match the number for the IntelliJ IDE that Android Studio is based on, 2020.3, plus our own patch number, as well as a handy code name to make it easier to remember and refer to. We'll be using code names in alphabetical order; the first is Arctic Fox, now in beta, and the next is Bumblebee, now in canary.

Today, we are excited to unveil Android Studio Arctic Fox (2020.3.1) Beta ❄️?: the latest release of the official Android IDE focuses on Design, Devices, and Developer Productivity. It is available for download now on the beta channel for you to try out all the new features launched this week during Google I/O 2021!

Inspired by developer communities around the world, who despite having to adjust to challenges this past year still continue to create amazing and innovative apps, we have delivered and updated the suite of tools to empower three major themes:

  • Rapid UI design - with Jetpack Compose, it's never been easier to create modern UIs, and we have tools to help complete that journey: you can create previews in different configurations and navigate your code with Compose Preview, test it in isolation with Deploy Preview to Device, and inspect the full app with Layout inspector. Throughout iterations, you can quickly edit strings and numbers and see immediate updates. Moreover, with the Accessibility Scanner in Layout Editor, your View based layouts are audited for accessibility problems.
  • New devices, both large and small - reimagine and extend your app beyond phones--whether it's for Wear OS, Google TV, or Android Auto, we have prepared new emulators and system images, and even authentic simulations for different testing scenarios: pair your watch and phone emulators with Wear OS Pairing, take a virtual run with Wear OS heart rate sensors, switch channels with GoogleTV Remote Control, and drive with Automotive OS Sensor Replay.
  • Developer productivity boost - we want to ensure your workspace and environment are ready for the latest systems and optimized for speed and quality. Now you can enjoy a whole slew of new features and improvements that come with a major update to Intellij 2020.3, test your app with what Android 12 has to offer, improve your app performance with the updated UI for Memory Profiler, understand background task relationships with WorkManager Inspector, and use Non-Transitive R classes IDE Refactoring to increase build speed.

In short, this is an upgrade you do not want to miss! ✨ There are many more features and improvements surrounding these themes you can find in this Beta version, so read or watch below for further highlights. Or, skip the reading, download Android Studio Arctic Fox (2020.3.1) Beta in the beta channel and try out the latest features yourselves today! Give us feedback and help us to continue to focus on the areas you care about most in the next version of Android Studio.

What's new in Android development tools (I/O 2021)


What’s in Android Studio Arctic Fox (2020.3.1) Beta

Below is a full list of new features in Android Studio Arctic Fox (2020.3.1) Beta, organized by the three major themes:

Design

  • Compose Preview - You can create previews of your Compose UI with Compose Preview! By using the @Preview annotation, Compose previews can be made to visualize multiple components at once in different configurations (i.e themes, device) as well as create a mental mapping for you to navigate your code.
Compose Preview

Compose Preview

  • Layout Inspector for Compose - You can now inspect layouts written in Compose with Layout Inspector. Whether your app uses layouts fully written in Compose or layouts that use a hybrid of Compose and Views, the Layout Inspector helps you understand how your layouts are rendered on your running device or emulator, obtain rich details (such as parameters and modifiers passed to each composable), and debug issues that might arise. As you interact with the app, you now also have the option to either enable Live Updates to constantly stream data from your device, or reduce performance impact on your device by disabling live updates and clicking the Refresh action as needed.
Compose Layout Inspector

Compose Layout Inspector

  • Deploy Preview to Device - Use this feature to deploy a snippet of your UI to a device or emulator. This will help to test small parts of your code in the device without having to start the full application. Your preview will benefit the same context (permissions, resources) as your application. You can click the Deploy to device icon on the top of any Compose preview or next to the @Preview annotation in the code editor gutter and Android Studio will deploy that @Preview to your connected device or emulator.
Using Deploy to device from preview and gutter icon

Using Deploy to device from preview and gutter icon

  • Live Edit of literals - Live Editing of literals allows developers using Compose to quickly edit literals (strings, numbers, booleans) in their code and see the results immediately without needing to wait for compilation. The goal of the feature is to increase your productivity by having code changes appear near instantaneously in the previews, emulator, or physical device.
Editing numbers and strings update immediately in the preview and on device

Editing numbers and strings update immediately in the preview and on device

  • Accessibility Scanner for Layout Editor - Android Studio now integrates with the Android Accessibility Test Framework to help you find accessibility issues in your layouts. When using the Layout Editor, click on the error report button to launch the panel. The tool will report accessibility related issues and also offers suggested fixes for some common problems (e.g. missing content descriptions, or low contrast)
Accessibility Test Framework Scanner in Layout Editor

Accessibility Test Framework Scanner in Layout Editor

Devices

  • Wear OS Pairing - We created a new Wear OS pairing assistant to guide developers step by step through pairing Wear OS emulators with physical or virtual phones directly in Android Studio! You can start by going to device dropdown > Wear OS emulator pairing assistant. Note that this will currently pair with Wear OS 2 companion, and Wear OS 3 will be coming soon. Learn more.
Wear OS emulator pairing assistant dialog

Wear OS emulator pairing assistant dialog

Phone + Watch emulators paired successful state

Phone + Watch emulators paired successful state

  • New Wear OS system images - a developer preview of the Wear OS 3 system image is now available so that you can use and play with the newest version of Wear OS!
Wear OS system image

Wear OS system image

  • Heart Rate Sensor for Wear OS Emulators - To help you test your Wear OS apps, the Android Emulator now has support for the Heart Rate Sensor API when you run the Wear OS emulator. Make sure you are running at least Android Emulator v30.4.5 downloaded via the Android Studio SDK Manager
Heart Rate Sensor for Wear OS Emulators

Heart Rate Sensor for Wear OS Emulators

  • Google TV Remote Control - On top of running the new Google TV UI, we now have an updated Remote control panel, which has mapping for the new Google TV remote controls features like: user profile, and settings.
Google TV remote controls

Google TV remote controls

  • New Google TV system images - We have updated the system images to reflect the new Google TV experience allowing you to freely explore the UI.
Google TV system image

Google TV system image

  • Automotive OS Sensor Replay - You can now use the Android Automotive emulator to simulate driving scenarios, with the ability to replay car sensor data (e.g. speed, gear), completing your development and testing workflow.
Android Automotive OS Sensor replay

Android Automotive OS Sensor replay

Developer Productivity

  • IntelliJ Platform Update - Android Studio Arctic Fox (2020.3.1) Beta includes the IntelliJ 2020.3 platform release ?, which has many new features such as Debugger interactive hints, new Welcome screen, and a ton of new code editor enhancements to speed up your workflow. Learn more.
  • Android 12 lint checks - We’ve added lint checks that are specific to building your app for Android 12 so that you can get guidance in context. To name a few -- we have built checks for custom declarations of splash screens, coarse location permission for fine location usage, media formats, and high sensor sampling rate permission.
  • Non-transitive R classes Refactoring - Using non-transitive R classes with the Android Gradle Plugin can lead to faster builds for applications with multiple modules. It prevents resource duplication by ensuring that each module only contains references to its own resources, without pulling references from dependencies. You can access this feature by going to Refactor > Migrate to Non-transitive R Classes.
  • Apple Silicon Support Preview - For those using MacOS on Apple Silicon (arm64) hardware, Android Studio Arctic Fox provides preview support for this new architecture.  The arm64 platform support is still under active development, but we wanted to provide you a release order to get your feedback. Since this is a preview release for the arm64 architecture, you will have to separately download this version from the Android Studio download archive page and look for Mac (Apple Silicon).
  • Extended controls in the Emulator tool window - Developers now have access to all extended emulator controls when the emulator is opened in a tool window. The extended controls will give developers powerful tools for testing their apps such as navigation playback, virtual sensors, and snapshots all within Android studio. To launch the Emulator within Android Studio go to Android Studio's Preferences > Tools > Emulator and select “Launch in a tool window."
Extended controls in the Emulator tool window

Extended controls in the Emulator tool window

  • Background Task Inspector - You can now utilize the Background Task Inspector to visualize, monitor, and debug your app's background workers when using WorkManager library 2.5.0 or higher. You can access it by going to View > Tool Windows > App Inspection from the menu bar. When you deploy an app on a device running API level 26 and higher, you should see active workers in the Background Task Inspector tab, as shown below. Learn more.
Background Task Inspector

Background Task Inspector

  • Parallel device testing with Test Matrix - Instrumentation tests can now be run across multiple devices in parallel and investigated using a new specialized instrumentation test results panel, called the Test Matrix, which streams the test results in real time. Learn more
Test matrix running tests across multiple devices in parallel

Test matrix running tests across multiple devices in parallel

  • Memory Profiler new recording UI - We have consolidated the Memory Profiler UI for different recording activities, such as capturing a heap dump and recording Java, Kotlin, and native memory allocations.
Memory Profiler: recorded Java / Kotlin Allocations

Memory Profiler: recorded Java / Kotlin Allocations

  • Updated system requirements - In order to ensure that we provide the best experience for Android developers, we are updating the system requirements when using Android Studio. These requirements also represent the configurations we use to thoroughly test Android Studio to maintain high quality and performance, and we plan to update them more frequently going forward. So, while you’re still able to use systems that fall below the requirements, we can’t guarantee compatibility or support when doing so. You can see the updated system requirements on the official developer site.

To recap, Android Studio Arctic Fox (2020.3.1) Beta includes these new enhancements & features:

Design

  • Compose Preview
  • Compose Layout Inspector
  • Deploy Preview to Device
  • Live Edit of literals
  • Accessibility Scanner in Layout Editor

Devices

  • Wear OS Pairing
  • Heart Rate Sensor
  • New Wear OS system images
  • Google TV Remote Control
  • Google TV system Images
  • Automotive OS Sensor Replay

Productivity

  • Intellij 2020.3.1
  • Android 12 lint checks
  • Non-transitive R classes Refactoring
  • Apple Silicon Support Preview
  • Android Emulator Extended Controls
  • Background Task Inspector
  • Test matrix
  • Memory Profiler new recording UI

You might also have seen other new features at I/O which are not included in the list above; they are included in Android Studio (2021.1.1) Bumblebee Canary since these features were not quite ready for a beta channel release:

Design

  • Interactive Compose preview
  • Compose Animation preview
  • Preview Configuration Picker
  • Animated vector drawable preview
  • Compose Blueprint Mode
  • Compose Constraints Preview for ConstraintLayout

Devices

  • Automotive OS USB Passthrough - Coming soon
  • Automotive OS Rotary Controls - Coming soon

Productivity

  • Kotlin Coroutines debugger
  • Device Manager
  • Gradle Instrumented Test Runner Integration in Android Studio
  • Gradle Managed Devices

Sessions at Google I/O 2021

With this exciting release, the Android Studio team also presented a series of sessions about Android Studio. Watch the following videos to see the latest features in action and to get tips & tricks on how to use Android Studio ?:


Getting Started

Android Studio Arctic Fox (2020.3.1) is a big release, and now is a good time to download and check out the Beta release to incorporate the new features into your workflow. The beta release is near stable release quality, but as with any beta release, bugs may still exist, so, if you do find an issue, let us know so we can work to fix it. If you’re already using Android Studio, you can check for updates on the Beta channel from the navigation menu (Help > Check for Update [Windows/Linux] , Android Studio > Check for Updates [OS X]). When you update to beta, you will get access to the new version of Android Studio and Android Emulator.

As always, we appreciate any feedback on things you like, and issues or features you would like to see. If you find a bug or issue, please file an issue. Follow us -- the Android Studio development team -- on Twitter and on Medium.

What’s new in Android Privacy

Posted by Sara N-Marandi, Product Manager, Android Platform Product

Android privacy

People want an OS and apps that they can trust with their most personal and sensitive information. Privacy is core to Android’s product principles. As shared in the “What’s new in Android Privacy” session, Android 12 continues to expand on this existing foundation by making the platform even more private.

This release will give users more transparency around the data being accessed by apps while providing simple controls to make informed choices. Android is also investing in reducing the scope of permissions so that apps only have access to the data they need for the features they provide. Let’s look at some of these important changes we’ve made in Android 12 to protect user privacy.

Privacy dashboard: Users often tell us that they want to understand what data apps use. With the new Privacy Dashboard, users will have a simple and clear timeline view of the last 24 hour accesses to location, microphone and camera. You can also share more context about your app’s data usage with a new permission intent API in Android 12. The Privacy dashboard will be available to try in Beta 2.

We encourage all developers to review your code and understand data access needs, including those in third-party SDKs, and make sure all accesses have justifiable use cases. To help with that, in Android 11 we added Data access auditing APIs to make it easy for you to audit your current data access. Use the APIs to untangle mapping of your code by tracking which part of your code accesses private data. The Privacy dashboard will be available to try in Beta 2.

Privacy dashboard and location access timeline

Figure 1. Privacy dashboard and location access timeline in the past 24 hours.

Microphone and camera indicators: In Android 12 we’re adding transparency to microphone and camera access. Going forward, users will know in real time when an app accesses their microphone or camera feeds. By simply going into Quick Settings, users can view the apps accessing their data. If the access is unwarranted, users can quickly navigate to the app permission page to revoke permissions.

Developers should review their use of microphone and camera and proactively remove unexpected access. For example, you should ensure that your app does not access these sensors before the user clicks on a feature that needs access. The Microphone and camera indicators will be available to try in Beta 2.

 Microphone and camera indicators and toggles

Figure 2. Microphone and camera indicators and toggles.

Microphone and camera toggles: You may have seen people placing stickers on cameras or plugging audio blockers into their phones. In Android 12, we’re introducing two new controls that allow users to quickly and easily cut off apps’ access to the microphone and camera on the device. To ensure user safety, emergency calls will be exempted.

If an app with permissions attempts to access the microphone or camera but the user has the sensors turned off, the system will display a message to inform the user that they must turn the sensors back on in order to use the app’s features. If your app follows permissions best practices, then you don’t need to do anything different to incorporate the toggle state. The Microphone and camera toggles will be available to try in Beta 2.

Approximate location: Over the last two releases, we’ve made location permission fine grained. First, we separated background and foreground access. Then, we added an “only this time” option to further restrict access to background location. We’re seeing users respond positively to these controls and are choosing them more often. When given the option, users elect to share less through foreground location access about 80% of the time.

In Android 12, we will give users more control over their location data. Users will have a clear choice regarding the precision of location provided to the app by selecting approximate location.

We encourage you to review your use case for location and request ACCESS_COARSE_LOCATION if your features don’t need the user’s precise location. You should also be prepared for users to reduce location precision. Please make sure your app still works when users select approximate. Approximate location will be available to try in Beta 1.

Location permission request dialog with approximate and precise selection

Figure 3. Location permission request dialog with approximate and precise selection

Clipboard read notification: Content copied to the clipboard can contain sensitive information as users frequently copy emails, addresses, and even passwords. Android 12 notifies users every time an app reads from their clipboard. Users will see a toast at the bottom of the screen each time an app calls getPrimaryClip() . The toast won’t appear if clipboard data originates from the same app. You can minimize access by first checking getPrimaryClipDescription() to learn about the type of data in the clipboard. The recommended best practice is to only access the clipboard when the user understands why the access occured. Clipboard read notification will be available to try in Beta 2.

Nearby device permissions: Android 12 minimizes data access by adding a new runtime permission for nearby experiences that do not use location. Up until now, apps such as watch and headphone companion apps required the location permission to scan for nearby Bluetooth devices for pairing. We heard from users and developers that this was confusing and led to granting the permission to access location data when it wasn’t needed. For apps targeting Android 12, you’ll have the option to decouple nearby device discovery from the fine location permission for use cases like pairing devices by using the new BLUETOOTH_SCAN permission and by declaring usesPermissionFlags=neverForLocation . Once the device is paired, apps can use the new BLUETOOTH_CONNECT permission to interact with it. Apps that use Bluetooth scanning for location must still have the location permission. Nearby device permissions will be available to try in Beta 1.

App hibernation: Last year we launched permissions auto-reset. If an app isn’t used for an extended period of time, Android automatically revokes permissions for the app. In the last 14 days permissions were reset for 8.5M apps. This year we’re building on permissions auto-reset by intelligently hibernating apps that have gone unused for an extended period - optimizing for device storage, performance and safety. The system not only revokes permissions granted previously by the user, but it also force-stops the app and reclaims memory, storage and other temporary resources. Users can bring apps out of hibernation simply by launching the app. App hibernation will be available to try in Beta 1.

Android 12 is our most ambitious privacy release to date. Along the way, we have engaged closely with our developer community to build a platform that puts privacy at the forefront while taking into consideration the impact on developers. We thank you for your continued feedback and support in making our platform private and safe for everyone. Learn more about these changes on the developer site.

What’s new in Jetpack

Posted by Florina Muntenescu, Android Developer Advocate

what's new in jetpack image

Android Jetpack is a suite of libraries, tools, and guidance to help developers follow best practices, reduce boilerplate code, and write code that works consistently across Android versions and devices. Today, 84% of the top 1000 apps on Google Play rely on Jetpack.

Here’s a round-up of the latest updates in Jetpack - an extended version of our What’s new in Jetpack talk!

New in Stable

CameraX

The CameraX library provides a unified API surface for accessing camera functionality across OS versions, including device-specific compatibility fixes and workarounds. Some of the latest improvements to the library address common feature requests, including support for adjusting exposure compensation and access to more detailed information about camera state and features. Additionally, camera settings like FPS range can now be changed via Camera2Interop while the camera is running. The library also brings support for the latest device and OS features, including high-dynamic-range preview, zoom ratio controls, and support for Android’s Do Not Disturb mode. Perhaps most importantly, though, the library has continued to address performance, resulting in faster image capture and faster initialization, especially on older devices.

Hilt

Hilt is Jetpack’s recommended dependency injection solution built on top of Dagger. As part of the transition to stable, Hilt’s ViewModel support has moved up into the core Hilt Android APIs and SavedStateHandle has been added as a default dependency available in the ViewModelComponent. Also, Hilt is now integrated with Navigation and Compose: you can obtain an annotated Hilt ViewModel that is scoped to a destination or the navigation graph itself. Developers have already started using Hilt in their apps. Read about their experience in this blog post.

Paging 3.0

The Paging library allows you to load and display small chunks of data to improve

network and system resource consumption. This release features a complete rewrite in Kotlin with first-class support for coroutines and Flow, asynchronous loading with RxJava and Guava primitives, and overall improvements to the repository and presentation layers.

The 3.0 release is a substantial improvement in usability over Paging 2, and the rewrite was planned with partial and staged migrations in mind so that developers can transition on their own schedules. Check out the Paging 3.0 documentation and the Paging 3.0 codelab for details and hands-on experience.

ConstraintLayout and MotionLayout

ConstraintLayout, Jetpack’s flexible system for designing layouts, and MotionLayout, an API aimed at managing motion and widget animation, are now stable. MotionLayout now includes support for foldable devices, image filters, and motion effects. To find out more about what’s new in design tools, check out this Google I/O talk.

Security Crypto

The Security Crypto library allows you to safely and easily encrypt files and SharedPreferences. To encrypt SharedPreferences, create an EncryptedSharedPreferences object with the appropriate key and scheme and then use it like a standard SharedPreferences object.

val prefs: SharedPreferences = EncryptedSharedPreferences.create(
        context,
        "prefs_file_name",
        mainKey,
        prefKeyEncryptionScheme = AES256_SIV,
        prefValueEncryptionScheme = AES256_GCM,
)
// Use the resulting SharedPreferences object as usual.
prefs.edit()
    .putBoolean("show_completed", true)
    .apply()
Fragment

Over the past year, the Fragment library has undergone a major effort to clean up its internal implementation and reduce undocumented behavior, making it easier for developers to follow best practices in their apps and write reliable tests. This lays the groundwork for future improvements to the library, like supporting multiple back stacks in Navigation, and it may require some work to accommodate strict enforcement of API contracts. In practice, you should pay careful attention to your tests after updating the library. Check out the Fragment release notes to see specific cases to watch out for.

Recent releases have also introduced ActivityResult integration, making it possible to register for Activity results from a fragment. Fragment has also added a new FragmentOnAttachListener interface to replace the less-flexible onAttachFragment method. Existing code that overrides this method in Fragment or FragmentActivity will still work, but we’ve deprecated onAttachFragment to help prevent new code from accidentally adopting a less-flexible approach.

// Obtain the fragment manager. May be a childFragmentManager,
// if in a fragment, to observe child attachment.
val fm = supportFragmentManager

val listener = FragmentOnAttachListener {
    fragmentManager, fragment ->
  // Respond to the fragment being attached.
}

fm.addFragmentOnAttachListener(listener)

New in Beta

Once a library is feature complete it moves to Beta for stabilization. At this moment, the APIs change only in response to critical issues or community feedback.

DataStore

DataStore provides a robust data storage solution that addresses the shortcomings of SharedPreferences while maintaining a simple, highly usable API surface. DataStore brings support for best practices like Kotlin coroutines with Flow and RxJava. DataStore allows you to store key-value pairs, via Preference DataStore or typed objects backed by protocol buffers, via Proto DataStore. You can also plug in your own serialization solution, like Kotlin Serialization.

New in Alpha

Alpha libraries are libraries under active development—APIs may be added, changed, or removed, but what’s in the library is tested and should be highly functional.

AppSearch

AppSearch is a new on-device search library which provides high performance and feature-rich full-text search functionality. Compared to SQLite, AppSearch supports multiple world languages, simplifies ranking query results, and offers lower latency for indexing and searching over large datasets.

AppSearch 1.0.0-alpha01 is released with LocalStorage support, which allows your application to manage structured data, called “documents”, and then query over it. Your application defines what the structure looks like using “schema types”. For instance, you can model a Message as a schema type with data such as subject, body, and sender.

Use builders to create documents of a schema type and then add them to storage. Querying for “body:fruit” will retrieve all documents with the term “fruit” in the body of the Message.

In Android S, AppSearch will also offer PlatformStorage so you can share your application’s data with other applications securely, and reduce your application’s binary size by not having to link additional native libraries. This is currently not available in Jetpack because the library doesn’t target the Android S SDK yet.

Centralized storage on Android S+ for integrating into device-wide search

Centralized storage on Android S+ for integrating into device-wide search

Room

Room is the recommended data persistence layer, providing increased usability and safety over the platform.

Room 2.4.0-alpha brings support for auto-migrations. When your database schema changes, you now declare an @AutoMigration and indicate from which version to which version you want to migrate, and Room generates the migrations for you. For more complex migrations, you can still use the Migration class:

@Database(
-   version = 1,
+   version = 2,
    entities = { Doggos.class },
+   autoMigrations = {
+         @AutoMigration (from = 1, to = 2)
+     }
  )
public abstract class DoggosDatabase extends RoomDatabase { }

Room 2.3.0 stable version brings experimental support for Kotlin Symbol Processing which, in our benchmarks of Kotlin code showed a 2x speed improvement over KAPT, as well as built-in support for enums and RxJava3.

Room has also introduced a QueryCallback class—which provides a callback when SQLite statements are executed, to simplify tasks like logging—as well as the new @ProvidedTypeConverter annotation, which allows more flexibility when creating type converters.

WorkManager

The WorkManager library—Android’s recommended way to schedule deferrable, asynchronous tasks that run even if the app exits or the device restarts—has made improvements to reliability with task reconciliation, ensuring all tasks are executed, and a variety of workarounds for specific Android OS versions.

The latest versions of WorkManager feature improved support for multi-process apps, including performance benefits from unifying work request scheduling to a single process and limiting database growth when scheduling many requests.

Version 2.7—now in alpha, which is targeted to the Android S SDK—provides additional support for the platform’s new foreground restrictions. See the Effective Background Tasks on Android talk for more details.

The Background Tasks Inspector is available in Android Studio Arctic Fox, allowing you to easily view and debug WorkManager jobs when using the latest versions of the library:

background tasts inspector

Background Tasks Inspector

Navigation

The Navigation library, Jetpack’s framework for moving between destinations in an app, now provides support for multiple backstacks and simplifies cases where destinations sit at the same depth, such as a bottom navigation bar.

Macrobenchmark

The Macrobenchmark library extends Jetpack’s benchmarking coverage to app startup and integrated behaviors like scrolling performance. The library can be used remotely to track metrics in continuous integration testing or locally with profiling results viewable from Android Studio. Check out the Google I/O talk on all the details:

For developers who’d like to integrate more closely with Google Assistant, the Google Shortcuts library provides a way to expose actions to Google Assistant and other Google Services through the existing ShortcutInfo class.

You can send up to fifteen shortcuts at a time through the ShortcutManager to be shown on Google Assistant, among other services, making them available for voice and other interactions.

To implement this, define a shortcut with an Intent and a capability binding; this binding provides semantically-meaningful information that will help Google services figure out the best way to surface it to users.

// expose a "Cappuccino" action to Google Assistant and other services
ShortcutInfoCompat siCompat =
  ShortcutInfoCompat.Builder(ctx, "id_cappuccino")
    .setShortLabel("Cappuccino")
    .setIntent(Intent(ctx, OrderCappuccino::class.java))
    .addCapabilityBinding(
        "actions.intent.ORDER_MENU_ITEM",
        "menuItem.name",
        asList("cappuccino")
    )
    .build()

ShortcutManagerCompat.pushDynamicShortcut(ctx, siCompat)
EmojiCompat

All user-generated content in your app contains ?, and supporting modern emoji is a key part of making your app ✨! The EmojiCompat library, which supports modern emoji on API 19 and higher, has moved to a new artifact :emoji2:emoji2, which replaces the previous :emoji:emoji artifact. The new emoji2 library adds ? automatic configuration using the AppStartup library (you don't have to add any code ??‍? to display ?‍❄️)!

AppCompat adds emoji2 starting with AppCompat 1.4. If your app uses AppCompat, users will see modern emoji ⭐ without any further configuration. Apps that aren't using AppCompat can add :emoji2:emoji2-views. For custom TextViews, you can support modern emoji by using the helpers in :emoji2:emoji2-views-helpers or by subclassing AppCompat views.

Jetpack Compose

Jetpack Compose is Android’s modern toolkit for building native UI. It simplifies and accelerates UI development on Android. Jetpack Compose is currently in beta, and planned to go stable in July. Many of the libraries listed here, as well as others that you might already be using, have introduced features specifically for integration with Jetpack Compose. Ranging from Activity to ViewModel, Navigation, or Hilt, all of these libraries can make adopting Compose in your app smoother. Find out more about about how to use them from this Google I/O talk:

Form factors

Jetpack makes it easier to work with different form factors, including foldables, large screen devices, and Wear devices. We've introduced new guidelines for large screen development along with improvements to Jetpack libraries such as WindowManager and SlidingPaneLayout. Read all the details in this blog post.

Conclusion

This was a (relatively) quick overview of what’s new in Jetpack. Check out the AndroidX release notes for all the update details of each library and the Google I/O talks for more information on some of them.

What’s new with Wear

Posted by Simon Earnshaw, Group Product Manager

WearOS image

We’re announcing our biggest update yet to the Wear platform, with new features, APIs and tools to help developers create beautiful, high quality wearable experiences. In this blog post we highlight how we’re making it easier to build great apps for Wear, and how you can start working with pre-release versions of these APIs and tools to prepare your app for the new platform.

First things first: tools

The first thing you’ll want to do is download and install Android Studio Arctic Fox Beta, which includes a developer preview of the new Wear system image as well as improved tools for developing and testing Wear apps without a device:

  • Emulator with new Wear system image (preview) - A developer preview of the new Wear system image is now available so that you can use and play with the newest platform updates!
  • Wear app to phone pairing - We’ve made it much simpler to pair Wear emulators with your phone directly from Android Studio, so you can stay in the IDE to develop, test, and iterate. The new pairing assistant guides you step by step through pairing Wear emulators with physical or virtual phones directly in Android Studio! You can start by going to Device Dropdown > Wear OS emulator pairing assistant. Note that this will currently pair with the Wear OS 2 companion, and a Wear companion for the new release will be coming soon. Learn more.
  • Virtual Heart Rate Sensor - The emulator now has a virtual heart rate sensor, including support for the Heart Rate Sensor API, to help you create and test apps that respond differently to activity levels. Make sure you are running at least Android Emulator v30.4.5 downloaded via the Android Studio SDK Manager.
 New Virtual Heart Rate Sensor in the Wear emulator allows the virtual heart rate to be adjusted with a slider bar

We also announced a new watch face design tool built by Samsung. This new tool will make it a breeze to develop watch faces for all devices running Wear, and is coming soon.

New developer documentation and design guidance

In preparation for the new version of Wear we’ve completely revamped our developer site with new API documentation, learning pathways, codelabs and samples. And with Wear soon to feature a completely new consumer experience based on the latest from Material Design, we’ve updated our design guidelines to cover the new design system, UI components, UX patterns, and styles. Learn more.

New Jetpack APIs

From new Jetpack APIs tailored for small (round or square) screens and designed to optimize battery life to the Jetpack Tiles API, we’re adding a number of new features to help you build great Wear experiences, reduce boilerplate code, and write code that works consistently across Wear versions and devices:

  • Tiles - Tiles give users fast, predictable access to the information and actions they rely on most. We’ve now opened up Tiles for developers, and we’ve already been working with several early access partners to add Tiles to their apps. Here are a few coming soon:
New tiles in development from Adidas, Sleep Cycle, Hole 19, Outdooractive, Calm, Flo, and Golfpad

The Tiles API is in alpha and supported on devices running Wear OS 2 and up, so you can create Tiles for all the devices in the Wear ecosystem. Tiles will start to show up on consumer watches with the new platform update. Learn more

  • Task switching and Ongoing Activities - The new version of Wear makes it easy for users to switch back and forth between apps. With a minimal amount of code, you can use the new Ongoing Activities API to let your users return to your app after they’ve navigated away (to start some other task such as music playback) by tapping an activity indicator icon at the bottom of the watch face, double tapping on the the side button, or via the Recents section of the global app launcher. The Ongoing Activities API is now in alpha. Learn more.
3 new ways for users to switch between apps: Activity indicator on the watch face; double tap the watch’s side button; the Global app launcher
  • Health Services - We also announced today the beginning of a health and fitness platform, created in collaboration with Samsung. This platform provides fitness and health data generated from sensors, contextually-aware algorithms, and all-day health monitoring. You can use the APIs to create high quality, powerful fitness and health experiences for wearables with a simpler development experience. The platform handles all the work to manage your hardware and sensors for you, removing one of the biggest challenges in managing it yourself - knowing when to stop work so the battery doesn't drain. The alpha of this Health Services platform is available today. Learn more.
  • Other new APIs - We’ve released several other new APIs in Jetpack to make wearable app development easier, including support for curved text, input, watch faces, complications and remote interactions. You can learn more about these APIs here.

Google Play Store changes

We know that user engagement and discovery of an app is an important part of growing your business, so big updates coming to Google Play will soon make it much easier for users to discover great app experiences on the watch, including using search to easily find apps for the watch, look at the Wear category for app recommendations, and install apps to the watch directly from the phone.

Learn more

We’re excited for the next generation of Wear. To learn more about developing apps for smartwatches, see d.android.com/wear. We’re excited to see what you build!

What’s new with Android for Cars

Posted by Mickey Kataria, Director of Product Management

For over a decade, Google has been committed to automotive, with a vision of creating a safe and seamless connected experience in every car. Developers like all of you are a crucial part of helping people stay connected while on the go. We’re seeing strong momentum across our in-car experiences, Android Auto and Android Automotive OS, and today, we’re excited to share the latest updates and opportunities to reach users in the car.

Check out our I/O session: What's new with Android for Cars

Android Auto

Android Auto, which allows users to connect their phone to their car display, now has over 100 million compatible cars on the road and is supported by nearly every major car manufacturer. Porsche is our newest partner and they will begin shipping Android Auto on new cars, starting this summer with the Porsche 911.

We’ve been working closely with car manufacturers to build an even better Android Auto experience by enabling wireless projection in more vehicles, extending availability to more countries, and continuing to launch new features, like integration into the instrument cluster. To see some of the newest Android Auto technology in the BMW iX, check out the video below.

Android Auto projecting to the cluster display in a BMW iX.

Android Automotive OS

Our newest in-car experience, Android Automotive OS with Google apps and services built-in, also has strong momentum. With this experience, the entire infotainment system is powered by Android and users can access Google Assistant, Google Maps, and more apps from Google Play directly from the car screen without relying on a phone. Cars from Polestar and Volvo, like the Polestar 2 and the Volvo XC40 Recharge, are already available to customers. And by the end of 2021, this experience will be available to order in more than 10 car models from Volvo, General Motors and Renault. You can get a sneak peek of this customized experience in the new GMC HUMMER EV below.

The all-electric GMC HUMMER EV infotainment features Android Automotive OS with Google built-in. Preproduction model shown. Actual production models may vary. Initial availability Fall 2021.

Developing new apps for cars

To support this growing ecosystem, we recently made the Android for Cars App Library available as part of Jetpack. It allows developers of navigation, EV charging and parking apps to bring their apps to Android Auto compatible cars. Many of these developers have already published their Android Auto apps to the Play Store and we’re now extending this library to also support Android Automotive OS, making it easy for you to build once and generate apps that are compatible with both platforms. We’re already working with Early Access Partners — including Parkwhiz, Plugshare, Sygic, ChargePoint, Flitsmeister, SpotHero and others — to bring apps in these categories to cars powered by Android Automotive OS.

Android for cars

PlugShare, an app for finding EV chargers, has used the Android for Cars App Library and Google Assistant App Actions to build for Android Auto.

We plan to expand to more app categories in the future, so if you’re interested in joining our Early Access Program, please fill out this interest form. You can also get started with the Android for Cars App Library today, by visiting g.co/androidforcars. Lastly, you can always get help from the developer community at Stack Overflow using the android-automotive and android-auto tags. We can’t wait to see what you build next!

What’s new in Android TV (and Google TV!)

Posted by Ben Serridge, Director of Product Management - TV Platforms and Dan Aharon, Product Manager

Android TV

Today at Google I/O 2021, we announced a significant milestone for our team: we have over 80 million monthly active devices on Android TV OS, with more than 80% growth in the US alone. We would not be here without the hard work of the developer community, so a huge and heartfelt thank you to you all.

Android TV OS is the operating system that powers a number of devices around the world including the new Google TV experience launched last fall. Google TV has generated a lot of excitement from consumers, developers, and industry partners alike, offering a content forward TV experience that helps the user discover more of the movies and shows they love. Google TV is available on streaming devices like the Chromecast with Google TV, smart TVs from Sony (and soon TCL!), and as an app on Android devices. Check out this presentation on how to get your app ready for Google TV.

Our goal is to always enable you to build better and more engaging experiences on Android TV OS. One example of this is the widely utilized Watch Next API which increases app re-engagement by ~30% in certain cases1. Well over 100 major media partners are already using WatchNext API and you can learn more about how to add your app here.

We are also announcing several new tools and helpful features to make developing for Android TV OS easier and enable you to create engaging experiences for your users. Some are already available and some will be available soon:

  • Cast Connect with Stream Transfer and Stream Expansion: Cast Connect allows users to cast from their phone/ tablet or Chrome browser onto your app on Android TV. Stream Transfer and Stream Expansion allow users to transfer media to other devices and/or play audio on multiple devices.
  • Emulator updates: To help you make your app work better on Google TV without requiring new hardware, we are now making our first Google TV Emulator available, running on Android 11. There will also be an Android 11 image with the traditional Android TV experience. You can now also use a remote that more closely mimics TV remotes directly within the Emulator.
  • Firebase Test Lab: Firebase Test Lab runs millions of tests every week on behalf of developers. Following requests from developers, we are excited to share that Firebase Test Lab is adding Android TV support. Firebase Test Lab Virtual Devices run your app in the cloud on Android TV emulators and allow you to scale your test across hundreds or thousands of virtual devices. Physical Devices will be coming soon.
  • Android 12 Beta 1: We are making the Android 12 Beta 1 available for TV on ADT-3 today. With this release the developer community will be able to take advantage of many of the changes and improvements coming with Android 12. We encourage you to try it and provide us with feedback.

Thank you for your continued support of the Android TV OS platform. The future of TV is bright and we can’t wait to see what you build next!

1 Average gain in number of days active in the app in a 28-day period amongst app 28DAUs, based on 3 apps analyzed during the 11/2020 - 2/2021 period.

The top Google Play updates from I/O ‘21

Posted by Alex Musil, Director of Product, Google Play

This year, we announced many great new features, tools, and updates to help you make the most of Google Play. You can check out all the updates in our I/O session, or keep reading for a quick overview of the new capabilities that will help take your business even further, from driving more installs to growing your engagement and revenue.

15% service fee for the first $1M in earnings

1. Earlier this year, we announced an additional service fee tier to help boost developer success on Google Play. Starting July 1st, the service fee will be 15% instead of 30% for your first $1M (USD) of earnings each year. You’ll be able to enroll for the new rate in Play Console the week of June 7th, so we’re sharing details about the process now to give you time to get ready.

New tools for managing policy compliance

2. We’ve built a new, dedicated Policy and Programs section in Play Console to provide you with a centralized place to see any policy compliance concerns, guidance on how to fix policy issues, and information about upcoming policy changes.

More SDK guidance

3. The new Google Play SDK Console lets providers report issues with their SDK versions so we can give you better guidance and recommendations. We’ve started with several large SDK providers and will continue to add more.

4. Later this year, we’re launching a new, public website with important insights about popular SDKs to help you choose the right SDK for your app. Learn more about how we’re helping you build safer and more stable apps in the I/O session below.

Helping more users discover your apps and games

5. To ensure that your store listing assets can help users anticipate your in-app or in-game experience and drive meaningful downloads, we’re pre-announcing a policy change for app metadata...

6. and introducing new guidelines on store listing preview assets.

Distribution features for the future of publishing

7. One million apps are in production using the Android App Bundle, with 15% size savings on average vs a universal APK. The app bundle is the future of publishing on Google Play and, starting August 1, 2021, they’ll be required for all new apps.

8. Based on developer feedback, we'll soon be launching an optional code transparency feature to offer additional cryptographic assurance that your app’s code on device has not been modified from its original version.

Identify growth opportunities with our new competitive insights

9. To help you understand your engagement and monetization trends and optimize your product plans, we’ve taken the best of our ecosystem data and contextualized your performance against peersets. Learn how to make the most of them in the I/O session below.

10. You can now also customize and pin the precise metrics that matter to you in a personalized KPIs section at the top of your app dashboard.

More features for a flexible monetization strategy

11. Your global reach just got even larger: In 2020, we added 34 new local forms of payment across 30 markets around the world.

12. We lowered the minimum prices developers can set for paid apps, in-app purchases, and subscriptions in 20 new markets across Latin America, EMEA, and APAC.

13. This year, we’ll be launching multi-quantity purchases, which will allow your users to buy more than one item at a time from the cart.

14. We’ll also be launching multi-line subscriptions, which will allow you to sell multiple products as part of a single subscription.

15. And finally, we’ll be launching prepaid plans, which will let you offer users access to content for a fixed amount of time. (Don’t worry, users can easily extend at any time.)

16. Want to take advantage of these new features? Many will be available when you integrate Play Billing Library version 4.0, and more will be rolling out later this year. As a reminder, new apps are required to integrate version 3.0 by August 2, 2021 or by November 1, 2021 for updates to existing apps.

Program enhancements to engage and retain users

17. This year, Google Play Pass expanded to over 40 markets, with more than 800 games and apps. Developers have on average more than doubled their Play revenue across participating titles in these markets. Let us know if you’d like to join!

18. Google Play Points expanded to 22 countries and added deeper integration with Play Console making it even easier for developers to onboard. Play’s loyalty program helps developers increase engagement and reduce churn with their most high value users. Developers can learn more about joining the program here.

More educational content

19. Want to learn more about any of these features? We’ve built a comprehensive website with best practices and resources to help you learn more about our programs and tools.

20. Last but not least, we’ve also added tons of new free courses to Google Play Academy. Whether you're about to launch your startup or grow your existing business on Play, Google Play Academy has you covered.

How useful did you find this blog post?

What’s new for Android developers at Google I/O

Posted by Karen Ng, Director, Product Management & Jacob Lehrbaum, Director of Developer Relations, Android & Play

As Android developers, we are all driven by building experiences that delight people around the world. And with people depending on your apps more than ever, expectations are higher and your jobs as developers aren’t getting easier. Today, at Google I/O, we covered a few ways that we’re trying to help out, whether it be through Android 12 - one of the biggest design changes ever, Jetpack, Jetpack Compose, Android Studio, and Kotlin to help you build beautiful high quality apps. We’re also helping when it comes to extending your apps wherever your users go, like through wearables and larger-screened devices. You can watch the full Developer Keynote, but here are a few highlights:

Android 12: one of the biggest design updates ever.

The first Beta of Android 12 just started rolling out, and it’s packed with lots of cool stuff. From new user safety features like permissions for bluetooth and approximate location, enhancements to performance like expedited jobs and start up animations, to delightful experiences with more interactive widgets and stretch overscrolling, this release is one of the biggest design updates to Android ever. You can read more about what’s in Android 12 Beta 1 here, so you can start preparing your apps for the consumer release coming out later this year. Download the Beta and try it with your apps today!

Android 12 visual

Jetpack Compose: get ready for 1.0 in July!

For the last few years, we’ve been hard at work modernizing the Android development experience, listening to your feedback to keep the openness–a hallmark of Android, but becoming more opinionated about the right way to do things. You can see this throughout, from Android Studio, a performant IDE that can keep up with you, to Kotlin, a programming language that enables you to do more with less code, to Jetpack libraries that solve the hardest problems on mobile with backward compatibility.

The next step in this offering is Jetpack Compose - our modern UI toolkit to easily build beautiful apps for all Android devices. We announced Compose here at Google I/O two years ago and since then have been building it in the open, listening to your feedback to make sure we got it right. With the Compose Beta earlier this year, developers around the world have created some truly beautiful, innovative experiences in half the time, and the response to the #AndroidDevChallenge blew our socks off!

With the forthcoming update of Material You (which you can read more about here), we’ll be adding new Material components as well as further support for building for large screens, making it fast and easy to build a gorgeous UI. We’re pressure testing the final bits in Compose and will release 1.0 Stable in July—so get ready!

Android Studio Arctic Fox: Design, Devices, & Developer Productivity!

Android Studio Arctic Fox (2020.3.1) Beta, the latest release of the official powerful Android IDE, is out today to help you build quality apps easier and faster. We have delivered and updated the suite of tools to empower three major themes: accelerate your UI design, extend your app to new devices, and boost your developer productivity. With this latest release you can create modern UIs with Compose tooling, see test results across multiple devices, and optimize debugging databases and background tasks with the App Inspector. We’re also making your apps more accessible with the Accessibility Scanner and more performant with Memory Profiler. And for faster build speeds, we have the Android Gradle plugin 7.0, new DSL, and variant APIs. You can learn more about the Android Studio updates here.

Android Studio Arctic Fox

Kotlin: the most used language by professional Android devs

Kotlin is now the most used primary language by professional Android developers according to our recent surveys; in fact, over 1.2M apps in the Play Store use Kotlin, including 80% of the top 1000 apps. And here at Google, we love it too: 70+ Google apps like Drive, Home, Maps and Play use Kotlin. And with a brand-new native solution to annotation processing for Kotlin built from the ground up, Kotlin Symbol Processing is available today, a powerful and yet simple API for parsing Kotlin code directly, showing speeds up to 2x faster with libraries like Room.

Android Jetpack: write features, not boilerplate

With Android Jetpack, we built a suite of libraries to help reduce boilerplate code so you can focus on the code you care about. Over 84% of the top 10,000 apps are now using a Jetpack library. And today, we’re unpacking some new releases for Jetpack, including Jetpack Macrobenchmark (Alpha) to capture large interactions that affect your app startup and jank before your app is released, as well as a new Kotlin Coroutines API for persisting data more efficiently via Jetpack DataStore (Beta). You can read about all the updates in Android Jetpack here.

Now is the time: a big step for Wear

The best thing about modern Android development is that these tools have been purpose built to help make it easy for you to build for the next era of Android, which is all about enabling devices connected to your phone–TVs, cars, watches, tablets–to work better together.

Starting today, we take a huge step forward with wearables. First, we introduced a unified platform built jointly with Samsung, combining the best of Wear and Tizen. Second, we shared a new consumer experience with revamped Google apps. And third, a world-class health and fitness service from Fitbit is coming to the platform. As an Android developer, it means you’ll have more reach, and you’ll be able to use all of your existing skills, tools, and APIs that make your mobile apps great, to build for a single wearables platform used by people all over the world.

Whether it’s new Jetpack APIs for Wear tailored for small screens and designed to optimize battery life, to the Jetpack Tiles API, so you can create a custom Tile for all the devices in the Wear ecosystem, there are a number of new features to help you build on Wear. And with a new set of APIs for Health and Fitness, created in collaboration with Samsung, data collection from sensors and metrics computation is streamlined, consistent, and accurate–like heart rate to calories to daily distance–from one trusted source. All this comes together in new tooling, with the release of Android Studio Arctic Fox Beta, like easier pairing to test apps, and even a virtual heart rate sensor in the emulator. And when your app is ready, users will have a much easier time discovering the world of Wear apps on Google Play, with some big updates to discoverability. You can read more about all of the Wear updates here.

Tapping the momentum of larger screens, like tablets, Chrome OS and foldables

When it comes to larger screens -- tablets, foldables, and Chrome OS laptops-- there is huge momentum. People are increasingly relying on large screen devices to stay connected with family and friends, go to school, or work remotely. In fact, there are over 250 million active large screen Android devices. Last year, Chrome OS grew +92% year over year–5 times the rate of the PC market, making Chrome OS the fastest growing and the second-most popular desktop OS. To help you take advantage of this momentum, we’re giving you APIs and tools to make optimizing that experience easier: like having your content resize automatically to more space by using SlidingpaneLayout 1.2.0 and a new vertical navigation rail component, Max widths on components to avoid stretched UIs, as well as updates to the platform, Chrome OS, and Jetpack windowmanager, so apps work better by default. You can learn more here.

Google Duo's optimized experience for foldable devices

Google Duo's optimized experience for foldable devices

This is just a taste of some of the new ways we’re making it easier for you to build high quality Android apps. Later today, we’ll be releasing more than 20 technical sessions on Android and Play, covering a wide range of topics such as background tasks, privacy, and Machine Learning on Android, or the top 12 tips to get you ready for Android 12. If building for cars, TVs, and wearables is your thing, we got that covered, too. You can find all these sessions - and more - on the I/O website. Beyond the sessions and news, there’s a number of fun ways to virtually connect with Googlers and other developers at this year’s Google I/O. You can check out the Android dome in I/O Adventure, where you can see new blog posts, videos, codelabs, and more. Maybe even test out your Jetpack Compose skills or take a virtual tour of the cars inside our dome!

What’s new in Android 12 Beta

Posted by Dave Burke, VP of Engineering

Android 12 logo

Today at Google I/O we unveiled the first Beta of Android 12, one of our most ambitious releases ever. We focused on a new UI that adapts to you, improving performance, with privacy and security at the core. For developers, we’re giving you more tools to build delightful experiences for people on phones, laptops, tablets, wearables, TVs, and cars.

There’s a lot to explore in Beta 1, starting with the most significant UI update to Android yet, created with a design language that we call Material You. There are new privacy features to try too, like approximate location, and a new standard called Performance Class that lets apps and users identify high-performing devices.

Try Android 12 Beta today on Pixel devices by enrolling here. Thanks to our device-maker partners who are working to accelerate updates, you can now get the Beta on other devices as well, including select devices from ASUS, OnePlus, Oppo, Realme, Sharp, TCL, Transsion, Vivo, Xiaomi, and ZTE, with others on the way. Visit android.com/beta to learn more.

Read on for more highlights of what’s new and visit the Android 12 developer site for details on everything in Android 12 and how to get started developing.

A new UI for Android

As we highlighted in our consumer blog post, Android 12 brings the biggest design change in Android's history. We rethought the entire experience, from the colors to the shapes, light and motion, making Android 12 more expressive, dynamic, and personal. This work is being done in deep collaboration between our software, hardware and Material Design teams, and we’re unifying our software and hardware ecosystems under a single design language called Material You.

Android 12 UI

We’ve extended the new design language across the platform and UI components, so your apps will get these upgrades automatically.

Redesigned widgets - Along with the design changes in Android 12 we’ve refreshed app widgets to make them more useful, beautiful, and discoverable. We added new interactive controls like checkboxes, switches, and radio buttons and made personalizing widgets easier. Android 12 widgets look great with our system UI and themes, with rounded corners and padding automatically adapted to every launcher and home screen. Responsive layouts let you adapt widgets to phones, tablets, foldables, and other screens. We also added dynamic color APIs so your widgets can use system colors to create a personalized but consistent look. And we’re making widgets easier to discover through an improved widget picker and an integration with the Assistant. Check out sample code and give the updated widgets a try. More here.

widgets in Android 12

Stretch overscroll - We’re also adding a new system-wide “stretch” overscroll effect to let users know they’ve scrolled past the end of the available content in your UI. The stretch effect provides a natural vertical and horizontal scroll-stop indicator that’s common across all apps, and it’s enabled by default for scrolling containers across the platform and AndroidX. The new stretch overscroll replaces the glow overscroll supported in previous versions. Make sure to test your apps and content with the new scrolling behavior, and if needed you can opt out. More here.

Smoother audio transitions - UI isn't just about the visuals. We've also improved the way that audio focus is handled. When an app loses audio focus, its audio is automatically faded out, providing a smoother transition between apps which play audio, and preventing apps from playing over each other. This is particularly relevant in foldable and multi-screen Android environments. More here.

Performance

With Android 12, we’ve made significant and deep investments in performance - from foundational performance that makes the system and apps faster and smoother, to a new standard for high-performing devices that helps developers deliver richer experiences on those devices.

Faster, more efficient system performance - We reduced the CPU time needed for core system services by 22%, so devices will be faster and more responsive. We also improved Android's power efficiency by reducing the use of big cores by the system server by 15% to help devices run longer before needing to charge.

Sampled rate , omn big core

We improved transitions and app startup times by reducing lock contention and latency variability, and we optimized I/O for faster app loading. In PackageManager, a read-only snapshot reduced lock contention by as much as 92%. In Binder, lightweight caching radically improved latencies up to 47x in targeted calls. In I/O, we accelerated dex/odex/vdex files to improve app load times, especially on low-memory phones. Our restriction on notification trampolines also helps reduce latency for apps started from a notification. For example, the Google Photos app now launches 34% faster after moving away from notification trampolines.

To improve database query performance we’ve optimized CursorWindow by inlining results in Binder transactions. For small windows, CursorWindow is 36% faster, and for windows over 1000 rows the improvements are as high as 49x.

Performance class - Starting with Android 12 and working together with our ecosystem partners, we’re introducing a common standard for high-performing Android devices.

This standard, called performance class, defines a set of capabilities that go beyond Android's baseline requirements. Devices that meet the performance class requirements can support more demanding use-cases and deliver higher quality content. Developers can check for performance class at runtime and then reliably deliver enhanced experiences that take full advantage of the device’s performance.

Initially, we’re focusing performance class capabilities on media use-cases, with requirements including camera startup latency, codec availability and encoding quality, as well as minimum memory size, screen resolution and read/write performance. More here.

Private by design

Privacy is at the heart of everything we do, and in Android 12 we’re continuing to give people more transparency and control while keeping their devices and data secure. Today we announced several new privacy features that will be coming in Beta 2 - Privacy Dashboard, microphone and camera indicators, and microphone and camera toggles. Stay tuned for more on these features. Here’s what’s new in Beta 1.

App hibernation - Last year we launched permissions auto-reset, and over the last two weeks, Android has reset permissions for over 8.5 million apps that weren’t being used - so apps that people have forgotten about can’t still access their data. In Android 12 we’re building on permissions auto-reset by intelligently hibernating apps that have gone unused for an extended period - optimizing for device storage, performance and safety. Hibernation not only revokes permissions granted previously by the user, but it also force-stops the app and reclaims memory, storage and other temporary resources. In this state the system also prevents apps from running jobs in the background or receiving push notifications, helping to keep users safe. Hibernation should be transparent for most apps, but if needed, direct users to Settings to turn off this feature for your app. More here.

Android 12 device location

Nearby device permissions - Previously, Bluetooth scanning required apps to have the location permission, which was a challenge for apps that needed to pair with nearby devices but didn’t actually need the device location. We’re now allowing apps to scan for nearby devices without needing location permission. Apps targeting Android 12 can scan using the new BLUETOOTH_SCAN permission with the usesPermissionFlags="neverForLocation" attribute. After pairing with a device, use the BLUETOOTH_CONNECT permission to interact with it. These permissions promote privacy-friendly app design while reducing friction for apps. More here.

Approximate location - Recently we’ve given people better ways to manage access to location, such as through separate permissions for foreground and background access and an “only this time” option. Now for apps targeting Android 12, we’re offering even more control with a new “approximate location” option. When apps request precise location data, users can now choose to grant either precise or approximate location. Users can also change an app’s location precision at any time from Settings. If your app requests precise location data (ACCESS_FINE_LOCATION), keep these changes in mind and make sure your app functions properly with approximate location only. For almost all general uses of location, we recommend asking for approximate location (ACCESS_COARSE_LOCATION) only. More here.

App compatibility

If you haven’t tested your app for compatibility with Android 12 yet, now is the time to do it! With Android 12 in Beta, we’re opening up access to early-adopter users as well as developers, on Pixel and other devices. This means that in the weeks ahead, expect many more users to be trying your app on Android 12 and raising any issues that they find.

To test for compatibility, install your published app from Google Play or other source on a device or emulator running Android 12 Beta and work through all of the app’s flows. Review the behavior changes to focus your testing. After you’ve resolved any issues, publish an update as soon as possible.

With Beta we’re getting closer to Platform Stability in August 2021. Starting then, app-facing system behaviors, SDK/NDK APIs, and non-SDK lists will be finalized. At that time, finish up your final compatibility testing and release a fully compatible version of your app, SDK, or library. More on the timeline for developers is here.

timeline

Get started with Android 12!

Today’s Beta release has everything you need to try the Android 12 features, test your apps, and give us feedback. Just enroll any supported Pixel device here to get the update over-the-air. If you’ve already installed a preview build, you’ll automatically get Beta updates. To get started developing, set up the SDK.

You can also get Android 12 Beta on devices from some of our top device-maker partners who are participating in the Android 12 Developer Preview program. Visit android.com/beta to see the full list of partners, with links to their sites with details on their supported devices. Each partner will handle their own enrollments and support, and provide the Beta updates to you directly.

For even broader testing on supported devices, try Android 12 Beta on Android GSI images, and if you don’t have a device you can test on the Android Emulator -- just download the latest emulator system images via the SDK Manager in Android Studio.

For complete details on how to get the Beta, visit the Android 12 developer site.

#AndroidDevChallenge – It’s a wrap!

Posted by The Jetpack Compose Team

From delightful doggos to creative countdowns and storming weather apps, the 2000 submissions to the #AndroidDevChallenge blew our socks off. We are truly amazed at the creativity and beauty of the apps you built with Jetpack Compose, Android’s new UI toolkit. Now that we judged the final challenge, let’s wrap up, look back at this incredible journey and find out who the winners are!

Week #1 - Puppy adoption app ?

The week that made us say “Aww” every time we check out our social media timelines. With this challenge you took your first steps with Compose and learned how to work with lists.

We already shipped the prizes to the first 500 successful submissions: a limited edition trophy of our Jetpack Compose superhero, made of LEGO bricks.

Jetpack Compose prize

Week #1 prize: Jetpack Compose superhero

Week #2 - Countdown timer ⏲️

When time came to implement a countdown timer, you didn’t disappoint! This challenge showed us that you mastered state and animation in Compose.

The first successful 500 submissions already got this week’s prize: a Compose poster pack.

Jetpack Compose prize

Week #2 prize: a Jetpack Compose poster pack

Week #3 - Speed round ?

We couldn’t believe how fast you were! This week you had to implement a design provided by us (the designs are still available if you want to try your hand at them in your own time). We opened the challenge in 3 different time zones, each with its own design to build. Here are the winning projects and the time it took to implement each of them:

  • WeTrade Jorge Baños - 2h 43min
  • MySoothe Nezih Yılmaz - 2h 44min
  • Bloom Takaki Hoshikawa - 5h 57min

It was incredible seeing how quickly the winners worked with themes and layouts in Compose; scoring themselves a Pixel 5 each!

Week #4 - Weather app ?

Come rain or shine, Android developers don’t disappoint! This week it rained… Compose weather apps. We judged them on 4 categories: code quality, novelty of idea, visual beauty and overall execution. As you made our job quite hard, we got some help from some of our Google Developer Experts to decide the winning projects:

Code quality: Paulo Pereira - JetWeatherfy

Novelty of idea: Roman Levinzon - Colony X Weather

Visual beauty: Chris Horner - Weather Scene

Overall execution: Corentin Bect - Flux

The winners each got a Google Pixel 5!


It was incredible to see what thousands of you built in this Jetpack Compose #AndroidDevChallenge. We hope that the challenge gave you a fun way to start learning Jetpack Compose and get ready to adopt it in your apps. If you’re new to Compose or want to dig deeper, check out our docs, codelabs & samples:

Have fun composing!