BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Android Studio 3.2 Beta 3 Brings Navigation Editor, Android App Bundle and More

Android Studio 3.2 Beta 3 Brings Navigation Editor, Android App Bundle and More

Leia em Português

Google has released Android Studio 3.2 Beta 3 in the Beta channel. This version brings a new Assistant panel and Navigation Editor, Android Jetpack, AndroidX migration, Android App Bundle, new Android Profiler, Lint checking, and more.

A new Assistant panel has been added to Android Studio, which informs of the latest changes. During the initialization of the Android Studio, the panel opens if it detects that there is new information to show. To open the Assistant panel, click Help > What's new in Android Studio. The core Android Studio IDE has been updated with improvements from IntelliJ IDEA through the 2018.1.1 release, which is mostly a bug-fix update, including an important fix that restores the automatic check for updates.

The new Navigation Editor is an experimental feature that aims to simplify the design and implementation of navigation between destinations (a specific screen in the app) in an app. Android Jetpack is a set of libraries, tools and architectural guidance to help developers build great apps more quickly and easily. The Navigation Editor integrates with the Navigation Architecture Component of Android Jetpack to provides a graphical view for creating the navigation structure of an app. To enable the Navigation Editor, click File > Settings (Android Studio > Preferences on Mac), select the Experimental category in the left panel, and check the box next to Enable Navigation Editor.

As part of Jetpack, Google is migrating the Android support libraries to a new Android extension library (AndroidX) using the androidx namespace. Android Studio 3.2 has provided a new feature to help developers through this process; to migrate an existing project to AndroidX, developers should choose Refactor > Migrate to AndroidX. Developers who want to start using AndroidX libraries immediately and don't need to convert existing third-party libraries can set the android.useAndroidX flag to true and the android.enableJetifier flag to false.

Android App Bundle is a new app publishing format to improve the way developers publish apps. Google Play's Dynamic Delivery uses the app bundle to generate and serve optimized APKs for each user's device configuration, so each user downloads only the code and resources they need to run the app. Furthermore, developers don't need to build, sign, and manage multiple APKs, and users get smaller apps.

Slices are UI templates that can display rich, dynamic, and interactive content from your app from within the Google Search app, and in other places like Google Assistant. Slices can help users perform tasks by enabling engagement outside of the fullscreen app experience.

Some new features have been added to Android Profiler in Android Studio 3.2, such as the Energy profiler that displays a visualization of the estimated energy usage of an app, which is useful for understanding the impact of an app on an Android device.

Developers can inspect the device's system CPU and thread activity using the new System Trace in the CPU Profiler. Furthermore, it is useful for investigating system-levels issues, such as UI jank, and you can visually mark important code routines in the profiler timeline by instrumenting your code with the Trace class.

With Android Studio 3.2, developers can inspect JNI references using the Memory Profiler. It is possible to inspect memory allocation for JNI code in apps deployed to a device running Android 8.0 (API level 26) or higher.

Another new feature only available for apps deployed to Android 8.0 or higher is the possibility to record CPU activity during app startup. Indeed, it is possible to export your CPU activity record as a ".trace" file. You can import and inspect ".trace" files created with the Debug API or CPU profiler into Android Studio 3.2.

Android Studio 3.2 includes a series of new and improved features for lint checking. New lint checks were added to make sure that both your Java and Kotlin code interoperates well. These checks include looking for the presence of Nullability annotations, placing lambda parameters last, etc. You need to add the following settings to your build.gradle to enable it:


android {
    lintOptions {
        check 'Interoperability'
    }
}

Other improvements brought by Android Studio 3.2 include:

  • Data Binding Library version 2
  • R8, a new tool for code-shrinking and obfuscation that replaces ProGuard
  • Improved editor for CMake build files with syntax highlighting and code completion, code reformatting, and safe refactoring
  • Navigation of external header files
  • Native multidex enabled by default
  • AAPT2 moved to Google's Maven repository
  • Android P Developer Preview
  • Sample Data, which allows developers to use placeholder data to aid in the design of an app
  • Material Design Update
  • Emulator Snapshots; with Quickboot it is possible to create snapshots at any emulator state and start them in under two seconds

If you have Android Studio set up to receive updates on the Beta channel, you can get the update by choosing Help > Check for Updates (Android Studio > Check for Updates on Mac). Otherwise, you can download it here.

Rate this Article

Adoption
Style

BT