Google Releases Stable Android Studio 4.0 With New Developer Features

It looks like it was yesterday (if yesterday was February) that Android Studio 3.6 came out with a bunch of useful additions and needed fixes. Today, a day (three months) later, Google has pushed Android Studio 4.0 to stable with even more useful additions and necessary fixes. Read on to find out more about what’s new.

Android Studio 4.0 changelog

Motion editor

The first feature we’re going to talk about is the motion editor. For almost two years now, AndroidX has had a subclass of ConstraintLayout called MotionLayout. The purpose of MotionLayout is to help you animate more easily between layout states. The only problem was that you had to create the transitions in XML yourself. With Android Studio 4.0, there is a new Motion Editor interface that allows you to visually create and edit transitions and animations in a MotionLayout. It all ends up in an XML file anyway, but you don’t have to write it yourself anymore.

New Layout Inspector

A very useful tool that Android Studio has had for some time is the Layout Inspector. On debuggable apps, it lets you see exactly how your app is presented on the screen, along with their various attributes. In Android Studio 4.0, the new and improved Layout inspector spans the old version. While you can still use it for a simple tree inspection, it now includes features like live refresh. Paired with devices running at least Android 10, you get even more features, like more detailed display attributes and a 3D representation of what’s on screen.

New Android Studio 4.0 Layout Inspector

Page layout validation

Perhaps one of the most difficult aspects of designing an application is creating the layouts. You can create a layout using the built-in preview in Android Studio, to make it look terrible on your phone or tablet. While it is possible to switch between different screen sizes and resolutions in the preview, this can be a problem. If this is something that bothered you, you’re in luck! Android Studio 4.0 adds a layout validation view, which lets you see what your layout will look like on a variety of different screen sizes and resolutions, at the same time.

Java 8 Desugaring for all APIs

Another boring part of developing for Android is trying to use the features of Java 8. You may have found some code that implements a Stream or you want to use a lambda function. Maybe there’s even a Java 8 API that you need that just isn’t practical to bypass. For some time now, the Android Gradle plugin has been able to compile some Java 8 features to older APIs, but starting with Android Studio 4.0, all Java 8 features should now be supported.


This list is far from being exhaustive. These are just a few of the cooler additions to Android Studio 4.0. Here is a summary of the main improvements and features introduced in the latest version, courtesy of Google:

Android Studio 4.0 changelog preview

Design

  • Motion Editor: a simple interface to create, edit and preview MotionLayout animations
  • Improved Layout Inspector: A real-time and more intuitive debugging experience
  • Layout validation: compare your user interface across multiple screen dimensions

Develop and profile

  • CPU Profiler update: improvements to make the user interface more intuitive to navigate and the data easier to understand
  • R8 Rules Update: Smart editor features for your code reduction rules, such as syntax highlighting, completion, and error checking
  • IntelliJ IDEA 2019.3 platform update with performance and quality improvements
  • Live Model Update: Android specific live models for your Kotlin code
  • Clangd Support: Clangd and Clang-Tidy enabled by default

To build

  • Build Analyzer: understand and resolve bottlenecks in your build
  • Java 8 Language Support Update: APIs You Can Use Regardless of Your Application’s Minimum API Level
  • Feature-on-feature dependencies: define dependencies between dynamic feature modules
  • DSL buildFeatures: Enable or disable discrete build features, such as data binding
  • Kotlin DSL: Core support for Kotlin DSL script files

If you’re interested in learning more about this update, be sure to check out the Google blog post and release notes for more details or watch the embedded video below for a visual preview.


Source link

Comments are closed.