By / Google Android Product Manager Jamal Eason, leveraging the momentum of Google I/O 2017, Android Studio 3.0 is now available for download in our Canary release channel. Android Studio is our official IDE built specifically for Android, and we continue to invest in improving this IDE. The feature set in Android Studio focuses on accelerating your application development flow and providing the latest tools built for the Android platform. To speed up your development flow, Android Studio 3.0 includes three major features:
-
A brand new application performance analysis tool for quickly diagnosing performance issues;
-
Support for the Kotlin programming language;
-
Accelerated Gradle build speed for large-scale application projects.
Android Studio 3.0 also tightly integrates Android platform development tools, offering the following additional important features:
-
Support for the development of install-free applications;
-
Google Play Store included in the Android O emulator system image;
-
A brand new Android O development guide.
In summary, the first Canary version of Android Studio 3.0 includes over 20 new features. We have quietly introduced many of these features in various Canary versions of Android Studio 2.4. Until today, we found that we have added many important features, and in order to improve scalability and shorten build times, we had to introduce a rare breakthrough change in the Android Gradle plugin, hence we renumbered this version to Android Studio 3.0. If you want to develop applications for Android O, wish to create install-free applications, want to start development using Kotlin, or want to use the latest Android application performance tools to enhance application quality, then you should download Android Studio 3.0 Canary 1 immediately.
▲ Android DevByte – New features in Android Studio 3.0 Canary 1
Below is a list of features organized by main development flow, from which you can find detailed information on the new features in the first Canary version of Android Studio 3.0.
Development
Kotlin Programming Language
By popular demand, Android Studio 3.0 now includes support for Kotlin. With support for this new language, you can seamlessly add Kotlin code alongside your existing Android application code and access all the great development tools available in Android Studio. You can choose to use the built-in conversion tool available in Code → Convert Java File to Kotlin File to add Kotlin to your project, or you can opt to create a project with Kotlin enabled using the New Project wizard. Learn more about Kotlin language support in Android and Android Studio.
▲ Kotlin language conversion in Android Studio
Java 8 Language Features
We continue to enhance support for Java 8 language features and APIs. With the recent deprecation of the Jack toolchain and migration to a javac-based toolchain, you can access many new features in Android Studio for projects using Java 8 language features, such as Instant Run. To update your project to support the new Java 8 language toolchain, simply update your source and target compatibility level to 1.8 in the Project Structure dialog.
▲ Updating Java 8 language in Project Structure dialog
Layout Editor
In this version of Android Studio, you will find more enhancements for the layout editor. We have updated the component tree, provided better drag-and-drop view insertion functionality, and introduced a new error panel. Along with updates to ConstraintLayout, the layout editor now supports creating view barriers and groups, and enhances chain creation functionality.
▲ Layout editor component tree and warning panel
Adaptive Icon Wizard
Android O introduces adaptive launcher icons, which can display as different shapes on different Android devices. The new Adaptive Launcher Icon wizard can create both new and legacy versions of launcher icon resources and preview how the adaptive icon will appear on different launcher screen icon masks. To create new resources, right-click on the /res folder in your project, then navigate to → New → Image Asset → Launcher Icons (Adaptive and Legacy).
XML Fonts and Downloadable Fonts
Now, using XML font preview and font selection tools in Android Studio, you can more easily add custom fonts to your applications (for Android O applications). You can also create downloadable font resources for your applications. With downloadable fonts, you can use custom fonts in your applications without having to bundle the font resources in the APK. To use downloadable fonts, ensure that your device or emulator is running Google Play services version 11.2.63 or higher.
▲ Downloadable font resource selector
▲ XML font preview
Android Things Support
With Android Studio 3.0, you can start developing Android Things using a set of new templates in the New Project wizard and New Module wizard. Android Things allows you to extend your Android development knowledge to the Internet of Things (IoT) device category.
▲ Android Things New Module wizard
IntelliJ Platform Updates:
Android Studio 3.0 Canary 1 includes IntelliJ version 2017.1, which includes Java 8 language refactoring, parameter hints, semantic highlighting, draggable breakpoints, enhanced version control search, and more.
Version
Install-Free Application Support
With Android Studio 3.0, you can create install-free applications in your projects. Install-free applications are lightweight Android applications that users can run directly without installation. To support install-free applications, Android Studio introduces two new module types: instant apps and features. With the new “modular” refactoring operation and the app link assistant, Android Studio can help you extend existing applications into install-free applications. To use this feature, you can use the New Module wizard or right-click a class and navigate to: Refactor → Modularize.
▲ Instant App Module wizard
Improvement in Build Speed
We continue to work on improving build speed. In this version, we focus on improving the build speed of projects with many modules. To enhance the build speed of these projects and support future enhancements, we made disruptive changes to the API of the Android Gradle plugin used by Android Studio. If you depend on the APIs provided by previous versions of the plugin, you should verify compatibility with the new plugin and migrate to the applicable APIs. Test and update the plugin version in your build.gradle file.
build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha1'}
Google’s Maven Repository
Additionally, by popular demand, we now distribute the Android support library’s Maven dependencies in a new Maven repository outside of the Android SDK Manager. This simplifies managing Maven dependencies for those developing with continuous integration (CI) systems. Combined with the latest command-line SDK manager tools and when used with Gradle, using Google’s Maven repository should simplify the management of CI builds. To use the new Maven location, add the following URL to your app module’s build.gradle file.
build.gradle
repositories {
maven {
url "https://maven.google.com"
}}
Testing and Debugging
Google Play System Images
As we update the Android O Beta version, we have also updated the Android Emulator O system images to include the Google Play Store. Bundling the Google Play Store allows you to test applications end-to-end using Google Play while also keeping Google Play services up to date in the Android Virtual Device (AVD). Just like updates for Google Play services on actual devices, you can also enable the same updates on AVD.
▲ Google Play Store in Android Emulator
▲ Updating Google Play services in Android Emulator
To ensure application security and an experience consistent with actual devices, the emulator system images that include the Google Play Store have been signed with release keys. This means you will not have elevated permissions. If you require elevated permissions (root) to help you troubleshoot application issues, you can use the Android Open Source Project (AOSP) emulator system images that do not include Google apps or services. To get started, ensure you are using Android Emulator v26.1+ and the latest system image API 24+, then create a new AVD using the Google Play icon next to the device definition.
▲ Android Virtual Device Manager with Google Play Store support
OpenGL ES 3.0 Support in Android Emulator
We continue to invest to provide you with a fast development experience, and the latest version of the Android Emulator introduces OpenGL ES 3.0 support for Android O system images, significantly enhancing OpenGL ES 2.0 graphics performance for older emulator system images. Most recent graphics cards support OpenGL ES 2.0 acceleration on all operating systems. To use OpenGL ES 3.0 with the Android Emulator, your development computer must support OpenGL 3.2 or higher host GPU graphics cards on Microsoft® Windows® or Linux (support for Apple MacOS® is coming soon).
▲ OpenGL ES 3.0 in Android Emulator
Application Error Reporter in Android Emulator
To help log errors in applications, we have added a simpler way to generate error reports, which provide all necessary configuration settings and space to capture reproduction steps. Additionally, we have added a link to quickly generate errors in the Android Issue Tracker when you want to share specific emulator errors with the Android team. To use this feature, navigate to Emulator Tool Bar → Extended Controls → Help → Emulator Help → File a Bug.
▲ Application error reporting in Android Emulator
Proxy Support in Android
For users who need to access the internet using an HTTP proxy, we have added a user interface to manage the proxy settings used by the emulator. By default, the Android Emulator will use the settings from Android Studio, but you can override these settings in your network settings. To configure, navigate to Extended Controls → Settings → Proxy.
▲ Android Emulator proxy settings
Rotary Input Controls in Android Emulator for Android Wear
Now, the Android Emulator supports rotary input controls for the Android Wear 2.0 emulator system image. Testing will now be easier for applications targeting Android Wear devices that include rotary input scrolling functionality. To enable this feature, create an Emulator AVD for Android Wear, and the Rotary Input panel should appear under extended controls.
▲ Rotary input in Android Emulator
APK Debugging
Now, for developers who do not want to build projects in Android Studio but want to debug APKs in it, Android Studio 3.0 has added the ability to debug any APK. This feature is particularly useful for users who write Android C++ code in other development environments and want to debug and analyze APKs in the Android Studio environment. As long as you have a debuggable version of the APK, you can use the new APK debugging feature to statically analyze, dynamically analyze, and debug the APK. Moreover, if you have access to the source code of the APK, you can link this source code to the APK debugging flow to improve the fidelity of the debugging process. Just select Profile or debug APK on the Android Studio Welcome Screen or choose File → Profile or debug APK to use this feature.
▲ Analyze or debug APK
▲ APK debugging
Layout Inspector
You will find that the layout inspector in Android Studio 3.0 provides several enhancements to simplify debugging layout issues in applications. These enhancements include better grouping of properties into common categories, as well as search functionality in the View Tree and Properties panels. Access the layout inspector while the application is running via Tools → Android → Layout Inspector.
▲ Layout inspector
Device File Explorer
By popular demand, we have migrated the Device File Explorer from DDMS to Android Studio, allowing users to view the file and directory structure of Android devices or emulators. Now, while testing applications, you can quickly preview and modify application data files directly in Android Studio.
▲ Device file explorer
Optimization Tools
Android Profiler
Android Studio 3.0 includes a new toolset to help debug application performance issues. We have completely rewritten the previous Android Monitor toolset, replacing it with the Android Profiler. Once you deploy your application to a running device or emulator, you can access the application’s CPU, memory, and network activity in real-time, unified view by clicking on the Android Profiler tab. Each performance event is mapped to the UI event timeline, which highlights touch events, key presses, and activity changes, allowing you to better understand when and why specific events occurred. Click on each timeline to dive deeper into the application’s performance.
▲ Android Profiler – Timeline combined view
CPU Profiler
Unnecessary CPU processing and load spikes are signs of poor application performance. With the CPU Profiler, you can trigger a sample or test CPU trace file to analyze the CPU thread usage of your application. Then, you can use the various data views and filters built into the CPU Profiler to troubleshoot CPU performance issues. Learn more.
▲ CPU Profiler
Memory Profiler
Low memory efficiency can lead to many device issues, including UI sluggishness and out-of-memory events. The Memory Profiler integrates the functionality of the previous heap viewer and allocation tracker into a rich interface to help debug memory usage issues in applications. You can diagnose various memory issues by analyzing memory allocations, heap dumps, and more.
▲ Memory Profiler
Network Profiler
By optimizing the application’s foreground and background network usage, you can improve application performance and reduce application data consumption. With the Network Profiler, you can monitor the application’s network activity, inspect the payload of each network request, and link back to the line of source code that generated the network request. The Network Profiler is an advanced profiling feature that can be enabled on devices and emulators running versions of Android before O by selecting Enable Advanced Profiling in the Profiling tab of the Run Configuration dialog. In addition to enabling network request and payload analysis, this checkbox also enables the highest level of event collection, memory object counting, and memory garbage collection. For devices and emulators based on Android O, simply deploy the application.
▲ Network Profiler
▲ Network Profiler settings on devices running versions of Android prior to O
APK Analyzer Enhancements
In Android Studio 3.0, we have added some additional enhancements to the APK Analyzer to help you further reduce the size of APKs. With this feature update, you can now analyze install-free application’s Zip files and AARs, view the dex bytecode of classes and methods, and generate Proguard configuration rules and load Proguard mapping files in the dex viewer.
▲ APK Analyzer
In summary, Android Studio 3.0 Canary 1 includes the following important new features:
Development
-
Kotlin Language
-
Java 8 Language
-
Layout Editor Enhancements
-
Adaptive Icon Wizard
-
XML Fonts and Downloadable Fonts
-
Android Things
-
IntelliJ Platform Update 2017.1
Building
-
Install-Free Application Support
-
Improvement in Build Speed
-
Changes to Google’s Maven Repository
Testing and Debugging
-
Emulator Google Play System Images
-
Emulator OpenGL ES 3.0 Support
-
Emulator Proxy Support
-
Application Error Reporter
-
Android Wear Rotary Input
-
APK Debugging
-
Layout Inspector
-
Device File Explorer
Optimization Tools
-
CPU Profiler
-
Memory Profiler
-
Network Profiler
-
APK Analyzer Enhancements
Getting Started
Download
If you are using a previous version of Android Studio, you can install Android Studio 3.0 Canary 1 alongside the stable version. You can download this update from the official Android Studio preview download page. As mentioned in this article, some disruptive changes were made to the Gradle Plugin API to support some new features in this IDE. Therefore, you should also update the Android Gradle plugin version in your current project to 3.0.0-alpha1, test and validate your application project settings. We appreciate any feedback you provide regarding features you like, issues you encounter, or features you would like to see. If you find any bugs or issues, feel free to submit them to us. Contact us (the Android Studio development team) on our Google+ information page or on Twitter.
For more details, to see all links in the text, please click “Read Original” at the end of this article.
Click “Read Original“, to view links in the text