Android Studio Giraffe is released, let's see what's new

Another "exciting" Android Studio update, this time the updated version is Giraffe | 2022.3.1, this updated Giraffe (Giraffe) upgrades the IntelliJ platform to version 2022.3, and also increases AGP support to 8.1 , Although the minimum support is 3.2, due to the built-in JDK17, some adjustments are required if you want to use a lower version of AGP. For details, see: "Come and adapt to AGP8 and JDK 17" .

This update mainly involves: new appearance UI, Live Edit improvement, Compose animation preview, new Device Explorer, new SDK upgrade assistant, Kotlin DSL, etc.

IDE enhancements

New UI for Android Studio (Preview)

The Giraffe version adopts a new IDE UI effect, including some Android Studio-specific changes, such as optimizing Android's default main toolbar and tool window configuration, updating icon styles, etc. The main changes are:

  • Simplified main toolbar with new VCS , Project and Run controls
  • Tool windows have a new layout
  • New light and dark themes, mostly improved contrast and color palettes
  • New icons improve so-called legibility

To use the new UI effect, you can open it in **Settings > Appearance & Behavior > New UI **, you can see the new UI changes include a simplified main toolbar, new Tool windows layout, new themes and icons, etc.

New diagnostic and error reporting tools

In the new UI, detailed problem feedback is provided through a new diagnostic and error reporting tool that makes it easier to report errors with associated log files attached.

The new bug reporting tool can be found in Help > Collect Logs and Diagnostic Data .

The specific steps are as follows:

  1. Launch the tool via Help > Collect Logs and Diagnostic Data , and you will see a dialog box appear allowing you to select the files to include
  2. Check or uncheck specific files to include in the diagnostic report, check a specific file to see its preview
  3. When ready to export the diagnostic report, agree to the terms and select Create
  4. Select a location to save the diagnostic report zip file and click Save

As part of this enhancement, the bug report template ( Help > Submit feedback ) has also been updated, which also emphasizes the importance of attaching log files. If you need to submit a bug, be sure to attach the log, as it is essential during debugging first step.

New Device Explorer

The new UI also comes with a new Device Explorer (called Device File Explorer in previous versions of Android Studio).

In Device Explorer, files and related operations are located in the Files tab, while in the new Processes Tab, users can view a list of debuggable processes for connected devices, and can also select a process and perform a kill, force stop, or attach a debugger to the given process.

**NOTE:** Options to terminate, force stop, or attach a debugger to a process have been moved from Logcat to Device Explorer.

Coding Adjustment

Live Edit & composables live update

Live Edit supports real-time editing. To use Live Edit, you can open it through Settings > Editor > Live Edit , and use Android Gradle Plugin (AGP) 8.1+ and Jetpack Compose Runtime 1.3.0 + versions.

Compose animation preview extension

Compose animation preview now supports many other Compose APIs, such as:

In addition, there are now new selectors to set non-enum or boolean states to support precise typing and debug Compose animations.

For all supported Compose Animation APIs, developers can play, pause, drag, and control speed for debugging.

Android SDK Upgrade Assistant

The new Android SDK Upgrade Assistant can view the steps required to upgrade targetSdkVersion or API level directly in the IDE .

It also pulls upgrade-related documentation directly from the official website into its tool window, which developers can now view without jumping back and forth between the browser and the IDE.

For each migration step, the Upgrade Assistant highlights the main breaking changes and how to resolve them, and even filters the full list of changes to show only App-related steps.

To open the Android SDK Upgrade Assistant, you can open it in Tools > Android SDK Upgrade Assistant .

Important note: From August 31, 2023, all apps must target Android 13 (API level 33) or higher in order to submit to Google Play for review, more can be found at: https://developer.android . com/google/play/requirements/target-sdk.

Improvements to the build system

Kotlin DSL in Gradle build scripts

Not only is Kotlin more readable, it also offers better compile-time checking and IDE support, and with Android Studio Giraffe, the Kotlin DSL is now supported in Gradle build scripts , meaning Kotlin will be the #1 default language used in project code , in addition to using Jetpack Compose's UI, it is now also possible to edit build scripts.

In short: Kotlin DSL is now the default for new Gradle builds .

When creating a new project or module starting from Android Studio Giraffe, the Kotlin DSL is now used by default.

If you want to migrate, you can check out the Kotlin DSL migration guide: https://developer.android.com/studio/build/migrate-to-kts.

Of course, this update will not affect existing projects using Groovy, Groovy projects will continue to work, there is currently no deprecation plan for Groovy support .

The relative compilation performance of using Kotlin DSL is slower than that of Groovy DSL, but Kotlin DSL also brings some other benefits:

  • Kotlin is statically typed for fast and accurate code hinting when editing Kotlin DSL build scripts

  • Syntax errors are more accurate and displayed when editing the Kotlin DSL build script, rather than when trying to sync the project:insert image description here

  • Type and method documentation can be obtained by pressing Control+Q (Command+B on macOS):

Additionally, experimental support for TOML-based Gradle release directories has been added this time, which allows developers to manage dependencies in one central location and share dependencies across modules or projects.

Android Studio now makes it easier to configure release directories through editor suggestions, integration with the project structure dialog, and the new project wizard.

Gradle download information during actual sync

The new sync tool window now includes the time spent downloading dependencies, a summary, and a detailed view of each repository download, which updates in real time as sync occurs, and can even help identify inefficiencies in configuring repositories.

Make a toolbar button for the selected module

With Android Studio Giraffe, it is now possible to build only the current module being processed by selecting the Make Selected Modules build option in the toolbar.

This new option checks that the code you just wrote compiles without building more code than needed.

Summarize

To sum up, the core of this update is the new Android Studio UI , that is, it has been updated to IntelliJ Platform 2022.3, so after opening the new UI, you need to adapt to the UI habits.

In addition, based on the new IntelliJ, many enhancements have been updated, such as the new Device Explorer and SDK Upgrade Assistant.

Secondly, the most important improvement of the build system is the default Kotlin DSL , and the display of detailed download information during Gradle synchronization.

The last is better support for Compose previews and animations.

So, are you ready? The brand new pit is calling for you.

Guess you like

Origin blog.csdn.net/ZuoYueLiang/article/details/131933247