The latest version of Android Studio is now available. Highlights of Android Studio 4.0 include a new Motion Editor and Build Analyzer, and improved versions of CPU Profiler and Layout Inspector. 

“During these uncertain times, we’re humbled by the many developers around the world who are finding ways to keep doing what they do best—create amazing apps for Android. Whether you’re working from your kitchen table on a laptop or from a home office, you need tools that keep up with you. Android Studio 4.0 is the result of our drive to bring you new and improved tools for coding smarter, building faster, and designing the apps your users depend on, and it’s now available on the stable channel,” Adarsh Fernando, product manager at Google, wrote in a post

Highlights include:

Design
Motion Editor is a GUI for creating, editing, and previewing MotionLayout animations. The MotionLayout API is an API for managing motion and widget animation in apps. With Motion Editor, developers can skip the process of creating and modifying XML files manually. It generates these files automatically and offers support for editing constraint sets, transitions, keyframes, and view attributes. 

RELATED CONTENT: Three smartphone trends worth watching

An improved version of Layout Inspector provides a more intuitive way of debugging UIs. It provides access to data and insights on how resources are being used. 

Android Studio 4.0 also introduces a Layout Validation feature that can be used to preview layouts on different screens and configurations simultaneously. 

Develop & Profile
CPU Profiler was overhauled in this release. As a result of user feedback, the team decided to separate CPU recordings from the main profiler timeline. They are now organized in groups that can be more easily analyzed. All thread activity can now be viewed in the Thread Activity timeline as well. The team also redesigned the System Trace UI with uniquely colored threads, sorting capabilities, and the ability to see data just for selected threads.

Android Studio 4.0 also adds smart editor features, such as syntax highlighting, completion, and error checking. When integrated with an Android project, it also provides full symbol completion for all classes, methods, and fields, as well as quick navigation and refactoring. 

Other development updates include the IntelliJ IDEA 2019.3 platform update, Kotlin live templates, and clangd support for C++.

Build
Build Analyzer is another new tool in this release. It offers insights into bottlenecks in a build by highlighting the plugins and tasks responsible for overall build time and suggesting ways to mitigate issues. 

Developers using Android Gradle plugin 4.0.0 or higher can also take advantage of the feature-on-feature dependencies. This means that developers can define relationships between modules and specify that a specific module is dependent on another. “Being able to define this relationship ensures that your app has the required modules to unlock additional functionality, resulting in fewer requests and easier modularization of your app. For example, a :video feature can depend on the :camera feature. If a user wants to unlock the ability to record videos, your app automatically downloads the required :camera module when it requests :video,” Fernando explained.

Java 8 language APIs are also now supported, and can now be used regardless of an app’s minimum API level. 

Other build features include the ability to enable or disable discrete build features and support for Kotlin DSL script files.