Just Released: Android Studio 3.0, Android 8.1 Developer Preview

Today is a big day for Android programmers as Google announced the availability of the latest version of its flagship IDE for mobile, Android Studio 3.0, while also launching a developer preview of Android 8.1 (Oreo).

Android Studio 3.0 features support for Kotlin, the hot programming language recently granted first-class status for Android development, joining the venerable Java. In this release, for the first time, Kotlin support is bundled inside the IDE.

Coders can use Kotlin via a built-in conversion tool (accessed via menu: Code > Convert Java File to Kotlin File), by creating a new file (File > New > Kotlin File/Class) or with the new option to create a Kotlin-enabled project in the New Project Wizard, which just requires ticking an "Include Kotlin support" checkbox.

Kotlin can also be added to an existing project, as detailed in the "Get Started with Kotlin on Android" post.

Android Studio 3.0 also comes with new functionality to profile apps in order to track down performance problems, including the new Android Profiler tool that replaces the previous set of Android Monitor tools.

Developers need only deploy an app -- to a real device or an emulator -- and click the new Android Profiler tab in order to immediately see CPU, memory and network activity in real-time. Each performance event is mapped to a timeline that depicts events such as touches and key presses in order to provide more context and let devs drill down for deeper details.

Converting to Kotlin
[Click on image for larger view.] Converting to Kotlin (source: Microsoft)

Many other new features were introduced to improve the development experience, the build process, testing and debugging, and more.

Concerning the development experience, new features of Android Studio 3.0 as listed by Google include:

  • Java 8 Language features -- In Android Studio 3.0, we are continuing to improve the support for Java 8 language features. With the migration to a javac based toolchain, using Java 8 language features in your project is even easier. To update your project to support the new Java 8 Language toolchain, simply update your Source and Target compatibility levels to 1.8 in the Project Structure dialog. Learn more.
  • Layout Editor -- The component tree in the Layout Editor has with better drag-and-drop view insertions, and a new error panel. Learn more.
  • Adaptive Icon Wizard -- The new wizard creates a set of launcher icon assets and provides previews of how your adaptive icon will look with different launcher screen icon masks. Support for VectorDrawable layers is new for this release. Learn more.
  • XML Fonts & Downloadable Fonts -- If you target Android Oreo (API Level 26 and higher) for your Android app, you can now add custom fonts & downloadable fonts using XML with Android Studio 3.0.
  • Android Things Support - Android Studio 3.0 includes a new set of templates in the New Project wizard and the New Module wizard to develop for the Android Things platform. Learn more.
  • IntelliJ Platform Update -- Android Studio 3.0 includes the IntelliJ 2017.1 release, which has features such as Java 8 language refactoring, parameter hints, semantic highlighting, draggable breakpoints, enhanced version control search, and more.

Also being introduced, Android product manager Jamal Eason said in a blog post, are wizards to help developers get a handle on the new Android Oreo APIs. That makes it easier to develop apps that leverage Oreo features such as Instant Apps, XML Fonts, downloadable fonts, and adaptive icons.

Speaking of which, the long-awaited and recently debuted Android Oreo is getting its first new iteration in the form of a version 8.1 developer preview.

It features optimizations for Android Go, a variant of the OS that targets lower-end devices with no more than 1GB of memory.

The language is also embracing new cutting-edge technologies, introducing a new Neural Networks API that lets developers leverage machine intelligence right on a mobile device. The AI-infused API will let Android coders build upon machine learning frameworks like TensorFlow Lite and Caffe2, said engineering VP Dave Burke in a blog post today.

Also new is a SharedMemory API that enables the creation, mapping and protection control over anonymous shared memory. By letting apps allocate shared memory, faster access to common data is enabled. The API is said by Burke to be parcelable and friendly with the Android Interface Definition Language (AIDL) while exposing useful features such as removing write permissions.

Other new features include autofill enhancements -- providing the functionality of the Autofill framework to password managers and other services -- that includes UI customization of the Save dialog and the ability to set a credit card expiration via a spinner control.

Along with using Android Studio 3.0 newly available in the stable channel, Burke recommended that developers updating to Android Support Library 27.0.0, available from Google's Maven repository.

Burke asked for feedback on the developer preview, which can be provided via the Android Developer community or Android Beta community.

About the Author

David Ramel is an editor and writer for Converge360.