Category Archives: Android Developers Blog

An Open Handset Alliance Project

Prepare your Android Project for Android Gradle plugin 8.0 API changes

Posted by Wojtek Kaliciński, Boris Farber, Android Developer Relations Engineers, and Xavier Ducrohet, Android Studio Tech Lead

To improve build speed and provide stable APIs, the Transform APIs will be removed in Android Gradle plugin (AGP) version 8.0. Most use cases have replacement APIs which are available starting from AGP version 7.2. Read on for more details.

The Android developer community's top request has been to improve build speed while making sure Android Gradle plugin (AGP) has a solid, stable, and well supported API.

To improve build speed starting from AGP 7.2, we have stabilized the Artifacts API and updated the Instrumentation API. For common use cases, these APIs replace the Transform APIs, which cause longer build times and are gone in AGP 8.0.

This article walks you through transitioning off the Transform APIs, whether you're working on a Gradle plugin or an application.

Guidance for Gradle plugins

To improve build times, we split Transform's functionality into the following APIs that are optimized for common use cases:

  • The Instrumentation API lets you transform and analyze compiled app classes using ASM callbacks. For example use this API to add custom traces to methods or classes for additional or custom logging.
  • The Artifacts API gives access to files or directories, whether temporary or final, that are produced by AGP during the build. Use this API to:
    • Add additional generated classes to the app, such as glue code for dependency injection.
    • Implement transformations based on whole program analysis, when all classes can be transformed together in a single task. This is only available starting from AGP 7.4.0-alpha06. The build.gradle.kts file in the “modifyProjectClasses'' Gradle recipe shows how to do it.

For examples of how to use the replacement APIs see the Transform API update note, and our Gradle recipes.

Guidance for apps

Make sure that you update your plugins to be AGP 8.0 compliant before updating your app to AGP 8.0. If the relevant plugins are not compliant, please create a bug that includes a link to this post and send it to the plugin authors.

Several commonly used plugins have already migrated to use these new APIs, including the Hilt Gradle plugin.

Share your feedback

If your use case is not covered by any of the new APIs, please file a bug.

We encourage you to get started with making your plugins compatible with the new AGP APIs. Getting started now means that you have enough time to familiarize yourself with the APIs, share your feedback and then upgrade your dependencies and plugins.

Android Dev Summit ‘22: Coming to you, online and around the world!

Posted by Yasmine Evjen, Community Lead, Android Developer Relations Android Dev Summit is back, and this year, we’re coming to you! Whether you’re tuning in online or–for the first time since 2019–joining in person at locations around the world, we can’t wait to see you! It’s your opportunity to learn from the source, about building excellent apps across devices.


Android Dev Summit ‘22 kicks off on October 24 with the keynote, your opportunity to hear directly from the Android team. We’ll cover the latest in Modern Android Development, innovations in our core platform, and how to take advantage of Android’s momentum across devices, including wearables and large screens. This technical keynote will be packed with demos, and it kicks off at 9AM PT on October 24, live on YouTube.

One of the most important parts of ADS are the deeply technical sessions, a huge part of what we look forward to at ADS. This year, we’ll be sharing the sessions live on YouTube in three tracks spread across three weeks:
  • Modern Android Development, live on Oct 24
  • Form Factors, live on Nov 9
  • Platform, live on Nov 14
ADS is a place where we get to connect directly with you - hearing what’s most important to you and how we can make it easier for you to build on Android. And there’s no better way to do that than connecting in-person. Since travel is still tough for many of you, we’re doing our best this year to come to you, with events popping up around the world. The first stop for ADS will be in the San Francisco Bay Area on October 24 (if you’re local, you can apply to come here). Next, ADS’22 moves to London on November 9 (apply here if you’re in London). The fun will continue in Asia in December with several roadshow stops (more details to come!).

If you’re not able to join us in person, we’d still love to connect! At the end of each of our session tracks, we’ll be hosting a live Q&A – #AskAndroid - for you to get your burning questions answered. Post your questions to Twitter or comment in the YouTube livestream using #AskAndroid, and tune in to see if we answer your question live.

Over the coming weeks, we’ll be dropping more info around ADS’22 on the website; check back when we release the full session track details and more, or sign up for updates through the Android Developer newsletter.

We can’t wait to see you soon!

**Hi everyone, I'm Yasmine Evjen, the new Community Lead for Android Developer Relations. I'm so excited to connect with you all in-person and virtually at #AndroidDevSummit. Bringing two of my favorite things together, exciting new tech and the developers that bring it to life.

Outdooractive boosts user experience on wearable devices with 30% less development time using Compose for Wear OS

Posted by The Android Developers Team

Outdooractive, Europe’s largest outdoor platform, provides trail maps and information to a global community of more than 12 million nature enthusiasts. As a platform focused on helping users plan and navigate their outdoor adventures, Outdooractive has long viewed wearable devices like smart watches as essential to the growth of their app. Users value wearables as navigation tools and activity trackers, so when Google reached out with Android’s new UI toolkit, Compose for Wear OS, Outdooractive’s developers jumped on the opportunity to improve their app for this growing market.

The application overhaul quickly showed the benefits of Compose for Wear OS. It cut development time by an estimated 30% for Outdooractive’s developers, accelerating their ability to create streamlined user interfaces. “What would have taken us days now takes us hours,” said Liam Hargreaves, the Senior Project Manager of Outdooractive.

Having a modern code base and increasing the development speed helped make the UI code more intuitive for the developers to read and write, allowing for faster prototyping in the design phase and more fluid collaboration. This helped the developers create a more convenient experience for users.

Using new tools to create an improved user experience

Outdooractive’s app strives to deliver accurate information in real time to the users’ wearable devices, including turn-by-turn navigation, trail conditions, and weather updates.

“Our app has a relatively complex set of interactions,” said Liam. “Each of these needs to be kept simple, quick, easy to access, and clearly presented — all whilst our customer could be standing on a hillside or in a storm or wearing winter hiking gear and gloves!”

New features in Compose for Wear OS helped the Outdooractive developers create a higher quality app experience for users on the go. The Chip component significantly improved the process for creating lists and allowed developers to use pre-built design elements, saving the team days of work. ScalingLazyColumn also optimized the creation of scrolling screens without the need for RecyclerView or ScrollView.

The developers were also excited by how easy it was to use the AnimatedVisibility component because it allowed them to animate functions that they previously didn’t have time for. The team especially appreciated how Compose for Wear OS made it much easier to present different UI states to the user by communicating “loading” or “error” conditions more clearly.

"Compose makes the UI code more intuitive to write and read, allowing us to prototype faster in the design phase and also collaborate better on the code." 


Experimentation without the overhead

Since implementing Compose for Wear OS, Outdooractive’s users have spent more time on wearable devices doing things they normally would have done on their phones, such as navigating hiking routes — a key UI goal that Compose for Wear OS helped the developers to achieve.

“We see wearables as a critical part of our product and market strategy — and the reaction from our users is extremely positive,” Liam said.

Outdooractive’s developers used another Android Wear OS capability called Health Services to implement fitness tracking features such as heart rate monitoring into the app by leveraging on-device sensors to offer an experience unique to wearable devices. Health Services on Wear OS automizes the configuration of all health- and fitness-related sensors; collects their data; and calculates metrics such as heart rate, distance traveled, and pace, making it easy for developers to implement sophisticated app features while also maximizing battery life. With Health Services and Compose for Wear OS, Outdooractive’s developers plan to further expand the app’s offerings that are made possible by body sensors.

Outdooractive’s streamlined process shows just how easy Compose for Wear OS makes application development because it gives developers the flexibility to experiment with different layouts without increasing development overhead.

Liam had clear advice for other developers considering using Compose for Wear OS: “Fully embrace it.”

Boost your wearable app’s capabilities

Jetpack Compose for Wear OS helps build more engaging user experiences for wearable devices.

To get a first look, watch the Wear OS talk from Google I/O or try the Compose for Wear OS codelab to start learning now.

Listen to our major Text to Speech upgrades for 64 bit devices.

Posted by Rakesh Iyer, Staff Software Engineer and Leland Rechis, Group Product Manager

We are upgrading the Speech Services by Google speech engine in a big way, providing clearer, more natural voices. All 421 voices in 67 languages have been upgraded with a new voice model and synthesizer.

If you already use TTS and the Speech Services by Google engine, there is nothing to do – everything will happen behind the scenes as your users will have automatically downloaded the latest update. We’ve seen a significant side by side quality increase with this change, particularly in respects to clarity and naturalness.

With this upgrade we will also be changing the default voice in en-US to one that is built using fresher speaker data, which alongside our new stack, results in a drastic improvement. If your users have not selected a system voice, and you rely on system defaults, they will hear a slightly different speaker. You can hear the difference below

Speaker change and upgrade for EN-US

Sample Current Speaker

Sample Upgraded Speaker


Speaker upgrades in a few other languages

Current

Upgraded

HI-IN

HI-IN

PT-BR

PT-BR

ES-US

ES-US


This update will be rolling out to all 64 bit Android devices via the Google Play Store over the next few weeks as a part of the Speech Services by Google apk. If you are concerned your users have not updated this yet, you can check for the minimum version code ,210390644 on the package com.google.android.tts.

If you haven't used TTS in your projects yet, or haven’t given your users the ability to choose a voice within your app, it's fairly straightforward, and easy to experiment with. We’ve included some sample code to get you started. 

Here’s an example of how to set up voice synthesis, get a list of voices, and set a specific voice. We finally send a simple utterance to the synthesizer.

public class MainActivity extends AppCompatActivity {
  private static final String TAG = "TextToSpeechSample";

  private TextToSpeech tts;

  private final UtteranceProgressListener progressListener =
new UtteranceProgressListener() {
    @Override
    public void onStart(String utteranceId) {
      Log.d(TAG, "Started utterance " + utteranceId);
    }

    @Override
    public void onDone(String utteranceId) {
      Log.d(TAG, "Done with utterance " + utteranceId);
    }

    @Override
    public void onError(String s) { }
  };

  private final TextToSpeech.OnInitListener initListener = new OnInitListener() {
    @Override
    public void onInit(int status) {
      tts.setOnUtteranceProgressListener(progressListener);
      for (Voice voice : tts.getVoices()) {
        if (voice.getName().equals("en-us-x-iog-local")) {
          tts.setVoice(voice);
          tts.speak("1 2 3", TextToSpeech.QUEUE_ADD, new Bundle(), "utteranceId");
          break;
        }
      }
    }
  };

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    tts = new TextToSpeech(this, initListener);
  }

  @Override
  protected void onDestroy() {
    if (tts != null) {
      tts.shutdown();
    }
    super.onDestroy();
  }
}


We are excited to see this upgraded experience in your app!

Listen to our major Text to Speech upgrades for 64 bit devices.

Posted by Rakesh Iyer, Staff Software Engineer and Leland Rechis, Group Product Manager

We are upgrading the Speech Services by Google speech engine in a big way, providing clearer, more natural voices. All 421 voices in 67 languages have been upgraded with a new voice model and synthesizer.

If you already use TTS and the Speech Services by Google engine, there is nothing to do – everything will happen behind the scenes as your users will have automatically downloaded the latest update. We’ve seen a significant side by side quality increase with this change, particularly in respects to clarity and naturalness.

With this upgrade we will also be changing the default voice in en-US to one that is built using fresher speaker data, which alongside our new stack, results in a drastic improvement. If your users have not selected a system voice, and you rely on system defaults, they will hear a slightly different speaker. You can hear the difference below

Speaker change and upgrade for EN-US

Sample Current Speaker

Sample Upgraded Speaker


Speaker upgrades in a few other languages

Current

Upgraded

HI-IN

HI-IN

PT-BR

PT-BR

ES-US

ES-US


This update will be rolling out to all 64 bit Android devices via the Google Play Store over the next few weeks as a part of the Speech Services by Google apk. If you are concerned your users have not updated this yet, you can check for the minimum version code ,210390644 on the package com.google.android.tts.

If you haven't used TTS in your projects yet, or haven’t given your users the ability to choose a voice within your app, it's fairly straightforward, and easy to experiment with. We’ve included some sample code to get you started. 

Here’s an example of how to set up voice synthesis, get a list of voices, and set a specific voice. We finally send a simple utterance to the synthesizer.

public class MainActivity extends AppCompatActivity {
  private static final String TAG = "TextToSpeechSample";

  private TextToSpeech tts;

  private final UtteranceProgressListener progressListener =
new UtteranceProgressListener() {
    @Override
    public void onStart(String utteranceId) {
      Log.d(TAG, "Started utterance " + utteranceId);
    }

    @Override
    public void onDone(String utteranceId) {
      Log.d(TAG, "Done with utterance " + utteranceId);
    }

    @Override
    public void onError(String s) { }
  };

  private final TextToSpeech.OnInitListener initListener = new OnInitListener() {
    @Override
    public void onInit(int status) {
      tts.setOnUtteranceProgressListener(progressListener);
      for (Voice voice : tts.getVoices()) {
        if (voice.getName().equals("en-us-x-iog-local")) {
          tts.setVoice(voice);
          tts.speak("1 2 3", TextToSpeech.QUEUE_ADD, new Bundle(), "utteranceId");
          break;
        }
      }
    }
  };

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    tts = new TextToSpeech(this, initListener);
  }

  @Override
  protected void onDestroy() {
    if (tts != null) {
      tts.shutdown();
    }
    super.onDestroy();
  }
}


We are excited to see this upgraded experience in your app!

Optimize for Android Go : Lessons from Google apps Part 2

Posted by Niharika Arora, Developer Relations Engineer

Building for Android Go involves paying special attention to performance optimizations and resource usage.

In part-1 of this blog, we discussed why developers should consider building for Android Go, some tips on optimizing the app memory and identified the standard approach to follow while fixing performance issues. In this blog, we will talk about the other vitals to pay attention to while building apps for Android Go.

Optimize your apps for Android Go

Improve startup latency

Improving app startup time requires a deep understanding of things that affect it.

  • Avoid eager initialization: Avoid doing eager work that may not be needed in your app’s startup sequence. The user launching your app is the most well-known reason a process starts, but WorkManager, JobScheduler, BroadcastReceiver, bound Services, and ContentProviders can also start your app process in the background. Avoid initializing things eagerly in your Application class like ContentProviders, or androidx initializers if possible (If they are not needed for any possible reason for your app process to start).
  • Move the tasks from UI thread to background thread

    • Identify operations which occupy large time frames and can be optimized.
    • Identify operations that consume more time than expected.
    • Identify operations which cause the main thread to be blocked.

If there are tasks which are taking longer and blocking the main thread, try to move them to a background thread or prefer using WorkManager
    • Check third party library initialization 
Lazy load third party libraries. A lot of libraries do have on demand initialization or disabling auto init options.
      • Check rendering time of webp / png images
        • Prefer webp images over jpg/png
        • Prefer svg for small icons.
        • Check if any layouts are invisible, but still spend time for the images to be loaded.
        • Explore using a low resolution image according to the memory capabilities of the device.
        • Remove unnecessary backgrounds/alpha from views.
    • Avoid synchronous IPCs on UI thread: Check for binder transactions keeping the main thread busy: Often there are multiple Inter process communication happening within the app. These could be anything like image / asset loading, third party libs loading, heavy work on application’s main thread like disk or network access etc. StrictMode is a useful developer tool to detect such accident usage.
    Identify and measure these transactions to understand :
        • How much time does this take and if it is expected & necessary ?
        • Is the main thread sleeping / idle / blocked during this time ? If yes, this could be a performance bottleneck.
        • Can this be delayed ?
    • Wisely use XML and Json parsing: The Gboard app optimized file list parsing by using Java code instead of XML parsing as they were parsing them out into memory as Java objects at runtime. So, GBoard did a work to convert all the XML into Java code at compile time, the latency then become time of class loading, which is much more faster, almost of previous. Benchmarking both XML and Json parsing for your app to identify the appropriate library to be used.
    • Analyze and fix severe disk read contention: To capture this, use StrictMode in your development environment.
      • Detects accidental disk or network access on the application's main thread, where UI operations are received and animations take place.
      • Can automatically terminate the app (or log it to logcat), when a violation has occurred by adding different penalties.

    Optimize app size

    Users often avoid downloading apps that seem too large, particularly in emerging markets where devices connect to spotty 2G and 3G networks with low bandwidth speed or work on pay-by-the-byte plans.

    • Remove unnecessary layouts: Gboard and Camera from Google teams validated the layouts which were unused or could be merged with small UI changes and removed the unnecessary layouts reducing overall app code size.
    • Migrate to dynamic layouts/views when appropriate: The apps deep dive and find out the layouts and views which can be dynamically rendered. They used merge and viewstub to further optimize their views and layouts.
    • Revaluate features with low DAU. Try to disable features which take more memory and make the app less performant: The team further analyzed their apps to specifically optimize for Android Go and disabled features on go devices which were not of much usage but were taking a lot of memory. They removed complex animations, large GIFs etc. to make space for parts of the app.
    • Try combine native binaries with common dependencies into one: If the app has different JNI implementations with a lot of common underlying dependencies - all the different binaries add up to the apk size with redundant components. Camera from Google app benefited from combining several JNI binaries into a single JNI binary while keeping the Java and JNI files separate. This helped the app reduce the apk size by several Mbs.
    • Try to reduce dalvik code size: Check for code that is never used at runtime, eg) large classes and auto-generated code.
      • Code optimizers like ProGuard () could help optimize and shrink code size, but they can't deal with codes guarded by runtime-constants. Replacing the check/flags with compile-time constants to make most usage of the optimization tools.
      • Reduce translatable strings size :
      a.    Don’t translate internal-only UI strings. Mark them as translatable = “false”. 
        
      b.    Remove unused alternative resources: You can use the Android Gradle plugin's resConfigs property to remove alternative resource files that your app does not need. if you are using a library that includes language resources (such as AppCompat or Google Play Services), then your app includes all translated language strings for the messages in those libraries whether the rest of your app is translated to the same languages or not. If you'd like to keep only the languages that your app officially supports, you can specify those languages using the resConfig property. Any resources for languages not specified are removed. 
       
      The following snippet shows how to limit your language resources to just English and French

        android {
            defaultConfig {
                ...
                resConfigs "en", "fr"
            }
        }

        You can read more here.

        c.    Don’t translate what doesn’t need translation: If the string does not participate in a UI, it should not be translated. Strings for the purpose of debugging, exception messages, URLs and so on should be string literals in code, not resources. 
        i.    Don’t translate what’s not shown to the user anyway
        It’s possible to have a String resource that’s practically never shown to the user, but is still strongly referenced. One example is in your <activity>, if you have an android:label set and referencing a String resource but the Activity’s label is never actually shown (e.g. it’s not a launcher Activity and it doesn’t have an app bar that shows its own label).
          
         d.    Don’t translate URLs:  Consider this example:
         

        <string name="car_frx_device_incompatible_sol_message">

        This device doesn\'t support Android Auto.\n

        <a href="https://support.google.com/androidauto/answer/6395843">Learn more</a>

        </string>

         
        You may recognize < and > - these are escape characters for “<” and “>”. They’re needed here because if you were to put an <a> tag inside a <string> tag, then the Android resource compiler would just drop them (as it does with all tags it doesn’t recognize).

        However, this means that you’re translating the HTML tags and the URL to 78 languages. Totally unnecessary.

        Instead, remove the part with HTML:

        <string name="car_frx_device_incompatible_sol_message">

        This device doesn\'t support Android Auto.

        </string>

         
        Note we don’t define a separate string for “Learn more”, because it’s a common string. To produce the HTML snippet for the link, we define "<a href="https://support.google.com/androidauto/answer/6395843>%s</a>" as a string literals in code, and then drop the value of “Learn more” from resources into the format specifier.
         
        e.    Inline untranslated stringsBy specifying strings in strings.xml you can leverage the Android framework to automatically change the actual value used at runtime based on the current configuration (e.g. based on the current locale, show a localized value for the string).    
         
        f.    Remove duplicate stringsIf you have the same string multiple times as a literal in code (“Hello World”), it will be shared across all instances. But resources don’t work this way - if you have an identical string under a different name then unless both are translated identically across 78 languages (unlikely) you’ll end up with duplicates.

        Don’t have duplicate strings!  

        g.    Don’t have separate strings for ALL CAPS or Title Case: Android has built-in support for case mutations. 

        Use android:capitalize (since API level 1). If set, specifies that this TextView has a textual input method and should automatically capitalize what the user types. The default is "none".

          • Reducing asset size: Be mindful of different target device form factors that your app supports and adjust your assets accordingly.
          • Upload your app with Android app bundles: The easiest way to gain immediate app size savings when publishing to Google Play is by uploading your app as an Android App Bundle, which is a new upload format that includes all your app’s compiled code and resources, but defers APK generation and signing to Google Play. Read more here.
          • Utilize dynamic delivery feature if applicable: Play Feature Delivery uses advanced capabilities of app bundles, allowing certain features of your app to be delivered conditionally or downloaded on demand. You can use feature modules for custom delivery. A unique benefit of feature modules is the ability to customize how and when different features of your app are downloaded onto devices running Android 5.0 (API level 21) or higher. Learn more here.

          Recap

          This part of the blog captures some best practices, recommendations and learnings from Google apps to optimize your app size, startup latency and improve go app experience that helps drive user engagement and adoption for your Android app. In part-3, you will get to know the tools that helped the Google apps identify and fix such performance issues in their app!

          Helping users discover apps for all their devices from their phone

          Posted by Marcus Leal, Product Manager, Google Play

          Over the years, Android has evolved to support more devices such as watches, tablets, TVs, and even cars. Apps and games are a critical part of this ecosystem as they power many of the unique digital experiences that we all enjoy and rely on. As a way to make it easier for users to find your great apps across all Android devices, we are making changes to the Google Play Store, enabling users to more easily discover and install apps on other devices directly from their phone.

          Updates to the Google Play Store phone app

          We recently introduced three updates to the Play Store phone app that will help your users’ devices work better together: homepages for non-phone devices, a device search filter, and the ability to remotely install an app to another device.

          Homepages for other devices

          Users with a Wear OS watch, Android TV OS, or car with Android Automotive can navigate to the Play Store “Other devices” page on their phone app to see app and game recommendations, and editorials tailored to their non-phone devices.

            

          Users can go to the “Other devices” page to get recommendations of apps and games optimized for non-phone devices.

          Search device filters

          Users can also find apps and games for their devices with the new device filter on the Play Store search page. Using the filter, the search results will only include apps and games that are compatible with their selected device.

          Users can use the device filters to easily find apps and games optimized for their Wear watch, Android TV, or Android Auto-enabled devices.

          Remote install to other devices

          After finding the right app or game for their device, users can install it remotely from their phone by selecting the target device and clicking the install button.


           
          Users can remotely install apps and games to their other devices from the Play Store on their phone.

          Changes to the Play Store website

          We also recently launched a major redesign of the Play Store website. In addition to simplifying navigation, improving accessibility, and showcasing new and more useful information, the new website makes it easier for users to discover and manage their apps and games across all their devices. This means that users can access the Play Store website on their computer or non-Android phone to browse, search, and remotely install apps and games to all of their Android devices.

          Users can access the Play Store website on their computer or non-Android phone to browse, search, and remotely install your apps and games to their Android devices.

          These changes were designed to give developers new opportunities to showcase their multi-device app experiences, driving more engagement across the Android ecosystem.




          How useful did you find this blog post?



          Just launched: Apply for support from Google Play’s $2M Indie Games Fund in Latin America

          Posted by Patricia Correa, Director, Global Developer Marketing

          As part of our commitment to helping all developers grow on our platform, at Google Play we have various programs focused on supporting small games studios. A few weeks ago we announced the winners of the Indie Games Festival in Europe, Korea and Japan, and the 2022 class of the Indie Games Accelerator.

          Today, we are launching the Indie Games Fund in Latin America. We will be awarding $2 million dollars in non-dilutive cash awards, in addition to hands-on support, to selected small games studios based in LATAM, to help them build and grow their businesses on Google Play.

          The program is open to indie game developers who have already launched a game - whether it’s on Google Play or another mobile platform, PC or console. Each selected recipient will get between $150,000 and $200,000 dollars to help them take their game to the next level, and build successful businesses.

          Check out all eligibility criteria and apply now. Priority will be given to applications received by 12:00 p.m. BRT, 31 October, 2022.

          For more updates about all our programs, resources and tools for indie game developers, follow us on Twitter @GooglePlayBiz and Google Play business community on LinkedIn.




          How useful did you find this blog post?




          Android Studio Dolphin

          Posted by Yuri Blaise, Product Manager, Android  

          The Android Studio team took a deep dive into making it easier to make high quality apps with the latest stable release of Android Studio Dolphin ?(2021.3.1). This release focuses on three key themes: Jetpack Compose, Wear OS, and development productivity.

          For Jetpack Compose, Android Studio Dolphin now features reliable tools to preview multiple screens and easily preview animations. Additionally, as you debug the user interface of your app, we introduce a handy Compose UI counter within the Layout Inspector to keep track of when your UI recomposes.

          With Android Studio Dolphin, we added a range of Wear OS features to help get your Wear apps, tiles, and watch faces ready for all of the Wear OS 3 devices. With an updated Wear OS Emulator, an intuitive Pairing Assistant, and new deployment flows for launch tiles and watch faces, it's easier and more efficient than ever to make great apps for WearOS.

          Lastly, to make you even more productive when using Android Studio, we enabled Gradle Managed Virtual Devices to centrally manage your test devices.

          To take a swim in our latest update, download it today.

          Read on or watch below to get a detailed description of the new features introduced in Android Studio Dolphin.

          Development tools

          • Intellij 2021.3 Platform Update - Android Studio Dolphin includes the Intellij 2021.3 release, which has features such as an improved Find Usages flow, Kotlin debugger updates, constant conditions inspection for Kotlin, improved code intentions previews and more. Learn More.
          • Gradle Managed Virtual Devices - If you've wanted to automate your app testing using emulators, but found it cumbersome to coordinate, and setup, then Gradle Managed Virtual Devices is for you. Just describe the virtual devices you need for your automated tests as a part of your build, and let Gradle take care of the rest. From SDK downloading, to device provisioning and setup, to test execution and teardown, Gradle manages the lifecycle of your virtual devices during instrumentation tests. Gradle further optimizes your test execution with new features that enable snapshot management, test caching, and test sharding to ensure your tests run efficiently, quickly, and consistently.
          Gradle Managed Virtual Devices also introduces a completely new type of device, called the Automated Test Device, which is optimized for automated tests, resulting in significant reduction in CPU and memory usage during test execution. Learn more.
          Gradle Managed Virtual Devices

          Jetpack Compose

          • Compose Animation Inspector - You can now see all supported animations at once and coordinate them with the Animation Preview inspector. You can also freeze a specific animation or scrub through an entire animation frame-by-frame. Animation Preview currently supports animations built with updateTransition and AnimatedVisibility.
          Compose Animation Inspector
          • Compose Multipreview Annotations - Instead of copying and pasting the same @Preview code everywhere across your app, you can define an annotation class that includes multiple preview definitions; that new annotation generates all those previews at once, allowing you to preview multiple devices, fonts, and themes at the same time without repeating those definitions for every single composable. Learn more.
          Multipreview annotations
            • Compose Recomposition Counts in Layout Inspector - To help debug your Jetpack Compose UI, you can now view recomposition counts for a Compose app in the Layout Inspector. With this tool, you can understand if your UI is updating too often, or just as you expect. For easier usage, recomposition counts and skip counts can optionally be shown in the Component Tree and Attributes panels. Learn more.
            Compose Recomposition Counts

            Wear OS

            • Wear OS Emulator Pairing Assistant - the Wear OS Emulator Pairing Assistant allows you to see Wear OS devices in the Device Manager, pairing one or more watch emulators with a single phone without having to navigate through multiple ADB commands and device combinations. As a bonus, you also don't have to re-pair devices as often because Android Studio remembers pairings after it closes. Learn more.
            Wear OS Emulator Pairing Assistant
              • Wear OS Emulator Toolbar - The Android Emulator toolbar now has new buttons and interactions that align to Wear OS physical devices; use it to trigger actions such as the palm gesture or to simulate tilting the device. To learn more, see common actions in the emulator.
              Wear OS Emulator Side Toolbar
              • Wear OS Direct Surface Launch - When deploying your WearOS app, it can be tricky at times to get your app to the right state, especially if you are working on features like Watch Face complications. With Android Studio Dolphin, you can create Run/Debug configurations for Wear OS tiles, watch faces, and complications that can be launched directly from Android Studio. Learn more.
              New Wear OS Run/Debug configuration types

              To recap, Android Studio Dolphin includes these new enhancements and features:

              Development Tools

              • Intellij 2021.3 Platform Update
              • Gradle Managed Virtual Devices
              Jetpack Compose Tools
              • Compose Animation Inspector
              • Compose MultiPreview Annotations
              • Compose Recomposition Counts in Layout Inspector
              WearOS
              • Wear OS Emulator Pairing Assistant
              • Wear OS Emulator Toolbar
              • Wear OS Direct Surface Launch

              Check out the Android Studio release notes, Android Gradle plugin release notes, and the Android Emulator release notes for more details.


              Getting Started

              Download

              Download the latest version of Android Studio Dolphin from the download page. If you are using a previous release of Android Studio, you can simply update to the latest version of Android Studio. If you want to maintain a stable version of Android Studio, you can run the stable release version and canary release versions of Android Studio at the same time. Learn more.

              To use the mentioned Android Emulator features make sure you are running at least Android Emulator v31.3.0 downloaded via the Android Studio SDK Manager.

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

              Learn Jetpack Compose at a Compose Camp near you!

              Posted by Kat Kuan, Developer Relations Engineer, Android

               Jetpack Compose is Android's modern toolkit that simplifies Android UI development. It's already used by thousands of apps around the world such as Twitter, Airbnb and Google Play; if you're not already using it, it's a great time to start. To make learning Compose even easier, we are launching Compose Camp, a series of in-person and virtual sessions where you can learn how to build Android apps with Jetpack Compose alongside your peers. Grab your “camping gear” and see how you can participate in a Compose Camp near you!

              Jetpack Compose accelerates app development by enabling you to use and maintain less code, giving you intuitive & powerful APIs so you can leverage the best of Android when building compelling experiences for your users. Google is committed to increasing opportunities for anyone to learn Android development, so we're making learning the latest best practices more accessible in ways that suit different learning styles. We’ve heard how enjoyable and impactful it can be to learn in a group setting from many of you, which is why we’re launching Compose Camp around the world. You can learn how to build Android apps with Compose with the support of peers and “camp leaders” to guide you along the way.



              Compose Camp is for beginners and experienced developers

              If you’re new to Android development or just getting started with programming, check out the Beginner track where you’ll learn basic programming concepts and fundamentals of app development, including how to build user interfaces with Jetpack Compose.

              If you’re an Android developer who wants to learn how to migrate from Views to Compose or are looking to learn more about building UI using advanced features, then the Experienced track is for you. You’ll start with the essentials of Jetpack Compose, and then dive deep into various Compose topics.


              Learning in a group can be more effective and fun

              Many of you have told us that you enjoy learning alongside others because of the support and help you get within the context of a community. Google developer communities are a great way to connect with students and peers in your industry, tackle technical challenges together, and learn skills from each other that you can apply directly to your projects. They will be hosting Compose Camps around the world over the next few months, so look for one near you!

              You can lead your own Compose Camp

              This is also a great opportunity to build your expertise through leading and teaching others; you can become a “Camp Leader.” We have everything you need to lead your own Compose Camp including materials to help you facilitate learning, guidance on how to run a session, sample slides, and materials to recruit a group of peers.


              Learn Compose at your own pace

              If “solo-camping” is more your style, check out these online courses that can be done at your own pace. The Android Basics with Compose course is recommended if you’re just getting started with Android development. If you already have some Android development knowledge, check out the Jetpack Compose for Android Developers course.

              We hope these resources are helpful for your journey in learning Android development and Compose. Looking forward to seeing you at Compose Camp!