By Jamal Eason, Android Product Manager
We are pleased to announce that Android Studio 4.2 is now available for download from the Stable release channel. The release focuses on an upgraded IntelliJ platform and new features designed to make Android app developers more productive.
We know that sometimes it’s not easy to upgrade an app project to the latest version. To address this, we have provided a new app Project Upgrade Assistant in Android Studio 4.2, which makes it easier to migrate projects and use the latest Android Gradle plugin API. In addition, we have made a number of enhancements to existing features such as Database Inspector, System Trace, SafeArgs support, Apply Changes, new Project wizard, and so on. If you’re using these features and looking for the next stable version of Android Studio, you can download Android Studio 4.2 right now!
Check out the video here for a step-by-step guide to the new features in Android Studio 4.2, following the main developer process.
The development of
-
IntelliJ IDEA Community Edition 2020.2 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 pass 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 at 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, we redesigned the visual effects of the new Project wizard to make it easier to discover Android device types, and also 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 understand the various module types you can add to your application.
New Project wizard and New Module Wizard
debugging
- Database Inspector Improvements – With Database Inspector, you can more easily manage and monitor your in-app databases. In this release, we have made some new optimizations. An offline mode has been added so that you can keep checking the application database even after a process is interrupted, making it easier to diagnose an application if it crashes. We’ve also added a convenient option to query history.
Use the Database Inspector to query historical records
- Retrace command line tool – As part of the application compilation process, R8 confuses Kotlin with Java programming language code. To reduce the memory footprint of the application, it confuses and shortens type and method names so that stack traces cannot be decoded. The Retrace command line tool obfuscates these names and uses the mapping.txt file to restore inline frames, again making the stack trace easy to understand. You can find this new standalone tool by going to./ SDK /cmdline-tools/latest/bin/retrace. Click here for more details.
build
- AGP Upgrade Helper – Migrating a project to the latest version of the Android Gradle plugin (AGP) can sometimes be tricky, especially when using deprecated apis. To address this issue and 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 ultimately update deprecated configurations globally.
AGP upgrade assistant
-
Apply Changes enhancements – You can use Apply Changes to push code and resource Changes to a running application without restarting the application. In Android Studio 4.2, we extended a number of Changes that are compatible with Apply Changes, and when running on devices or emulators with Android 11 or older, We can add resources (23% of the changes that require a full restart) and add static final fields (such as constants).
-
Android Gradle plugin 4.2 – We have 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 additional AGP updates in detail.
// build.gradle.kts
android {
...
signingConfigs {
config {
...
enableV3Signing(true)
enableV4Signing(true)
}
}
}
Copy the code
△ APK V3 and APK V4 signatures are supported
test
- Multi-device deployment – When developing and testing an application, multi-device deployment can sometimes help you deploy your application to multiple devices to see the results. This feature was a feature in earlier versions of Android Studio, and now we’ve reintroduced it and integrated it directly into the device selection menu in Android Studio 4.2. Note that if you deploy tests to multiple devices, you may be prompted to enable this behavior.
▽ Deployment of multiple devices
Performance analysis
- System Trace improvements – For detailed application performance features, you can use System Trace functionality within 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. This new table view gives you a one-stop view of the BufferQueue, RSS memory counters, and CPU core frequencies in a compact user interface.
Performance profiler using the new System Trace event table
In brief review, Android Studio 4.2 includes the following new optimizations and features:
The development of
- IntelliJ 2020.2.3 platform update
- Safe Args support
- The new project wizard and module wizard are updated
debugging
- Improvements to the Database Inspector
- Retrace Command line tool
build
- AGP upgrade Assistant
- Apply Changes to optimize
- Android Gradle plugin 4.2
test
- Multiple device Deployment
Performance analysis
- The System Trace improvement
For more details, see Android Studio version notes, Android Gradle plugin version notes, and Android Emulator version notes.
Quick learning
You can go ahead and 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 a stable version of Android Studio, you can run both Android Studio Arctic Fox Stable and Canary. Click here for more details.
You’re welcome to give feedback and share your thoughts on what you like, what you’ve found, or what features you’d like to see. If there are any errors or questions, feel free to submit them to us. You are also welcome to continue to pay attention to us, timely understanding of the latest developments.
Java is a registered trademark of Oracle and/or its subsidiaries.