Android Studio 3.0
At its I/O 2017 developer conference, Google today unveiled Android Studio 3.0, the latest version of its integrated development environment (IDE). You can download the new version for Windows, Mac, and Linux now directly from developer.android.com/studio. The latest release isn’t yet ready for all developers, but you can get a preview of what’s coming in the Canary channel. The biggest news is Kotlin support, but even if you’re not interested in that, there’s plenty of new functionality as well.
Google released Android Studio 2.3 in March. As denoted by the major version number bump today, this is a preview of a big new release (work started in the version 2.4 Canaries, but Google renumbered the release because of the many significant features).
Indeed, this Canary version brings over 20 new features to the IDE:
01. Kotlin Programming Language: You can seamlessly add Kotlin code next to your existing Android app code. Add Kotlin to your project using the built-in conversion tool (Code → Convert Java File to Kotlin File) or choose to create a Kotlin enabled project with the New Project Wizard.
02. Java 8 Language features: To update your project to support the new Java 8 Language tool chain, simply update your Source and Target compatibility levels to 1.8 in the Project Structure dialog.
03. Layout Editor: The component tree has been updated with better drag-and-drop view insertions and a new error panel. In coordination with an update to ConstraintLayout, the Layout Editor also supports creating view Barriers, creating Groups, and enhances Chain Creation.
04. Adaptive Icon Wizard: Android O introduces adaptive launcher icons, which can display in different shapes across different Android devices. This wizard creates the new and legacy launcher icon assets and provides previews of how your adaptive icon will look on different launcher screen icon masks. Create a new asset by right-clicking on the /res folder in your project then navigate to → New → Image Asset → Launcher Icons (Adaptive and Legacy).
05. XML Fonts & Downloadable Fonts: Adding custom fonts to your Android O app is now easier with the XML fonts preview and font selection tools. You can also create a downloadable font resource (Google Play Services v11.2.63 or higher required) for your app to avoid bundling a font resource into your APK.
06. Android Things Support: You can start developing on Android Things with a new set of templates in the New Project wizard and the New Module wizard.
07. IntelliJ Platform Update: IntelliJ 2017.1 is included, adding features such as Java 8 language refactoring, parameter hints, semantic highlighting, draggable breakpoints, enhanced version control search, and more.
08. Instant App Support: Create Instant Apps in your project thanks to two new module types (instant app and feature) plus a new Modularize refactoring action and the App Links Assistant. To use you can use the New Module Wizard or right-click on a class and navigate to: Refactor → Modularize.
09. Build Speed Improvements: Speed has improved for projects with many modules. The cost is breaking API changes to the Android Gradle plugin, so if you depended on APIs provided by the previous plugin you should validate compatibility with the new plugin and migrate applicable APIs. To test, update the plugin version in your build.gradle file.
10. Google’s Maven Repository: The Android Support Library maven dependencies are being distributed outside of the Android SDK Manager in a brand new Maven repository. Continuous Integration builds should now be easier to manage with Google’s Maven Repository (add https://maven.google.com to your app module’s build.gradle file).
11. Google Play System Images: The Android Emulator O system images include the Google Play Store so you can do end-to-end testing of apps with Google Play and keep Google Play services up-to-date in your Android Virtual Device (AVD). Just as Google Play services updates on physical devices, you can trigger the same updates on your AVDs. The emulator system images with the Google Play store included are signed with a release key so you cannot get elevated privileges.
12. OpenGL ES 3.0 Support in Android Emulator: Significant improvements in OpenGL ES 2.0 graphics performance for older emulator system images. To use OpenGL ES 3.0 with the Android Emulator, your development machine needs a host GPU graphics card that supports OpenGL 3.2 or higher on Windows or Linux (MacOS support coming in the future).
13. App Bug Reporter in Android Emulator: An easier way to generate a bug report with all the necessary configuration settings and space to capture your repro steps. There’s also a link to share a specific emulator bug with the Android team (Emulator Tool Bar → Extended Controls → Help → Emulator Help → File a Bug).
14. Proxy Support in Android: A user interface has been added to manage the proxy settings used by the emulator. By default, the Android Emulator will now use the settings from Android Studio, but you can override these settings for your network setup (Extended Controls → Settings → Proxy).
15. Android Wear Rotary Controls in Android Emulator: Rotary controls for the Android Wear 2.0 emulator system image. Test your Android Wear apps that include rotary input scrolling by creating an Emulator AVD that targets Android Wear and the Rotary Input panel should appear under Extended controls.
16. APK Debugging: Debug an arbitrary APK. As long as you have a debuggable version of your APK, you can use the new APK Debugging features to analyze, profile, and debug it. If you have access to the sources of your APK, you can link the source to the APK debugging flow for a higher fidelity debugging process. Selecting Profile or debug APK from the Android Studio Welcome Screen or File → Profile or debug APK.
17. Layout Inspector: Better grouping of properties into common categories, search functionality in both the View Tree and Properties Panels, and while an application is running you can access the Layout Inspector via Tools → Android → Layout Inspector.
18. Device File Explorer: Ported from DDMS, the new Device File Explorer allows you to view the file and directory structure of your Android device or emulator. As you are testing your app, you can now quickly preview and modify app data files directly in Android Studio.
19. Android Profiler: The previous set of Android Monitor tools has been rewritten and replaced with the Android Profiler. Once you deploy your app to a running device or emulator, you can access a real-time and unified view of the CPU, Memory, & Network activity for your app. Each of the performance events are mapped to the UI event timeline which highlights touch events, key presses, and activity changes. Click on each timeline to dig into each performance aspect of your app.
20. CPU Profiler: Analyze the CPU thread usage of your app by triggering a sample or instrumented CPU trace. You can troubleshoot CPU performance issues using a variety of data views and filters.
21. Memory Profiler: Combines the functionality of the previous Heap Viewer and Allocation Tracker in one rich interface to help debug memory usage problems in your app. You can diagnose a range of memory issues by analyzing memory allocations, heap dumps, and more.
22. Network Profiler: Monitor the network activity of your app, inspect the payload of each of your network requests, and link back to the line of source code that generated the network request. Currently, the network profiler works with HttpURLConnection, OkHttp, and Volley network libraries.
23. APK Analyzer Improvements: Further optimize the size of your APK by analyzing Instant App zip files and AARs, plus view dex bytecode of classes and methods. You can also generate Proguard configuration rules and load Proguard mapping files in the dex viewer.
Again, this is a very early preview of Android Studio 3.0. The good news is that you can install it alongside your stable version. That’s important because if you want to target Android O, create an Instant App, start developing with Kotlin, or use the latest Android app performance tools, you’ll need Android Studio 3.0