Author/Android Product Manager Jamal Eason

We are pleased to announce that Android Studio 4.2 is now available for download from the stable release channel. This release will focus on an upgraded IntelliJ platform and new features designed to make Android application developers more productive.

As we all know, sometimes it’s not easy to upgrade an application project to the latest version. To address this issue, Android Studio 4.2 provides a new application project upgrade assistant that makes it easier to migrate projects and use the latest Android Gradle plug-in API. In addition, we made a number of optimizations to existing features such as Database Inspector, System Trace, Safeargs support, Apply Changes, New Project Wizard, etc. If you’re using these features and looking for the next stable version of Android Studio, you can download Android Studio 4.2 right away!

Click here for a video that introduces the new features in Android Studio 4.2, in turn, through the main developer flow.

The development of

  • IntelliJ Platform Update — Android Studio 4.2 includes all major features and updates in IntelliJ IDEA Community Edition 2020.2, These include a new GitHub PR interface and a new centralized question feedback window. Click here for more details.
  • Safe Args Support – If you want to transfer data between two target locations in your application when using the JetPack navigation component, Safe Args is recommended to ensure data encapsulation. Using Android Studio 4.2, you can now automatically complete the code for Directions Args and navigate the code from source to XML. Click here for more details.

△ Safe Args support

  • New Project Wizard and Module Wizard Updates – In this release, to make it easier to discover Android device types, we have redesigned the visual look of the new project wizard and added a ViewBinding to each template. In addition, we have updated the visuals of the new module wizard to make it easier for you to see the various types of modules you can add to your application.

New project wizard and new module wizard

debugging

  • Database Inspector Improvements – With the Database Inspector, you can more easily manage and monitor your in-app databases. In this release, we have made some new optimizations. Added offline mode so you can keep checking your application database after a process outage, making it easier to diagnose an application after it crashes. We also added a convenient query history option.

△ Use the Database Inspector to query history

  • The Retrace command line tool – R8 mixes Kotlin and Java programming language code as part of the application compilation process. To reduce the memory footprint of the application, type and method names are obfuscated and shortened so that the stack trace cannot be decoded. The Retrace command line utility obfuscates these names and uses the mapping.txt file to restore the inline frame, again making the stack trace easy to understand. You can find this new standalone tool at./ SDK /cmdline-tools/latest/bin/retrace. Click here for more details.

build

  • AGP Upgrade Assistant – Migrating a project to the latest version of the Android Gradle plugin (AGP) can be tricky, especially when using deprecated APIs. To solve this problem and to better prepare for the transition to Android Gradle plugin 7.0, we have developed a new Upgrade Assistant. With this helper, you can switch commands executed for a project to upgrade to a higher version of AGP, preview files that will be affected by the AGP upgrade, and finally make global updates to deprecated configurations.

△ AGP upgrade assistant

  • Apply Changes Enhancement – You can push code and resource Changes to a running application through Apply Changes without restarting the application. In Android Studio 4.2, we extended a number of Changes that are compatible with Apply Changes. When running on an Android 11 or older device or emulator, We can add resources (23% of the changes that require a full restart) and static final fields (such as constants).
  • Android Gradle plugin 4.2 – We made some significant changes with AGP 4.2. First, we implemented a new resource compiler to improve build performance, especially on Windows devices. Second, we have updated the default Java programming language to version 8. Finally, we added support for the APK V3 and APK V4 signature formats. You can see the documentation for more details on other AGP updates.
// build.gradle.kts

android {
   ...
   signingConfigs {
      config {
          ...
          enableV3Signing(true)
          enableV4Signing(true)
      }
   }
}

△ APK V3 and APK V4 signature support

test

  • Multi-device deployment – When developing and testing your application, multi-device deployment can sometimes help you deploy your application to more than one device to see the results. This feature was a feature in earlier versions of Android Studio, but now we’ve reintroduced it and integrated it directly into the device selection menu in Android Studio 4.2. It is important to note that you may be prompted to enable this behavior if you deploy tests to multiple devices.

Multiple device deployments

Performance analysis

  • System Trace Improvements – For detailed performance features of your application, you can use the System Trace functionality inside the Android Studio Performance Profiler with this improvement. In this version of Android Studio, we have now introduced a new event table for System Trace. With this new table view, you can view BufferQueue, RSS memory counters, and CPU core frequencies all in one compact user interface.

△ A performance profiler using the new System Trace event table

In a brief review, Android Studio 4.2 includes the following new optimizations and features:

The development of

  • The IntelliJ 2020.2.3 platform update
  • Safe Args support
  • New project wizard and module wizard updates

debugging

  • Database Inspector improvements
  • The Retrace command line tool

build

  • AGP Upgrade Assistant
  • Apply Changes to optimize
  • Android Gradle plugin 4.2

test

  • Multi-device deployment

Performance analysis

  • The System Trace improvement

For more details, see the Android Studio version description, the Android Gradle plug-in version description, and the Android Emulator version description.

Quick learning

You can go to download the latest version of Android Studio 4.2. If you are using a previous version of Android Studio, you can simply update to the latest version of Android Studio. If you want to keep the stable version of Android Studio, you can run both the stable and Canary versions of Android Studio Arctic Fox. Click here for more details.

Feedback is welcome, sharing what you like, what you find, or what you think you’d like to see. If there are any errors or questions, please feel free to submit them to us. You are also welcome to continue to pay attention to us, keep abreast of the latest developments.

Java is a registered trademark of Oracle and/or its affiliates.