Google unveils Android Studio 3.0 with new performance profiling tools, Instant Apps and Kotlin
Join Gaming Leaders, Alongside GamesBeat and Facebook Gaming, for Their 2nd Annual GamesBeat & Facebook Gaming Summit | GamesBeat: Into the Metaverse 2 from January 25-27, 2022. Learn more about the event.
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 now download the new version for Windows, Mac and Linux directly from developer.android.com/studio. The latest version isn’t ready for all developers just yet, but you can get a preview of what’s coming to the Canary Channel. The biggest new feature is Kotlin support, but even if that doesn’t interest you, there are plenty of new features as well.
Google released Android Studio 2.3 in March. As the major release number today indicates, this is a preview of a big new release (work started in 2.4 Canary, but Google renumbered the release due to many important features ).
Indeed, this Canary version brings more than 20 new features to the IDE:
- Kotlin programming language: You can easily add Kotlin code alongside 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 compatible project with the New Project wizard.
- Java 8 language features: 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.
- 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 sight barrier creation, group creation, and improved chain creation.
- Adaptive Icon Wizard: Android O features adaptive launcher icons, which can be displayed in different forms on different Android devices. This wizard creates 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 the /res folder in your project, then navigating to → New → Image Asset → Launcher Icons (Adaptive and Legacy).
- XML fonts and downloadable fonts: Adding custom fonts to your Android O app is now easier with XML font preview and selection tools. You can also create a downloadable font resource (Google Play Services v11.2.63 or later required) for your app to avoid bundling a font resource in your APK.
- Android object support: You can start developing on Android Things with a new set of templates in New Project wizard and New Module wizard.
- IntelliJ platform update: IntelliJ 2017.1 is included, adding features like Java 8 language refactoring, parameter hints, semantic highlighting, draggable breakpoints, improved version control search, and more.
- Instant app support: Create instant apps in your project with two new types of modules (instant app and feature), as well as a new Modularize refactoring action and the app link wizard. To use it, you can use the New Module wizard or right-click on a class and navigate to: Refactor → Modularize.
- Build speed improvements: Speed improved for projects with many modules. The cost breaks the Android Gradle plugin API changes, so if you depended on the APIs provided by the previous plugin, you need to validate compatibility with the new plugin and migrate the applicable APIs. To test, update the plugin version in your build.gradle file.
- Google’s Maven Repository: Android Support Library maven dependencies are distributed outside 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).
- Google Play system images: Android Emulator O system images include the Google Play Store so you can perform end-to-end testing of apps with Google Play and keep Google Play services up-to-date in your Android Virtual Device (AVD). Just like Google Play Services updates on physical devices, you can trigger the same updates on your AVDs. Emulator system images with included google play store are signed with version key so you can’t get elevated privileges.
- OpenGL ES 3.0 support in Android Emulator: Significant OpenGL ES 2.0 graphics performance improvements for older emulation 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 soon).
- Bug Reporter App in Android Emulator: An easier way to generate a bug report with all necessary configuration settings and space to capture your breeding steps. There is also a link to share a specific emulator bug with the Android team (Emulator Toolbar → Extended Controls → Help → Emulator Help → Report Bug).
- Proxy support in Android: A UI 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 configuration (Extended Controls → Settings → Proxy).
- Android Wear rotary controls in Android emulator: Rotary controls for Android Wear 2.0 emulator system image. Test your Android Wear apps that include rotary input scrolling by creating an AVD emulator that targets Android Wear and the rotary input panel should appear under the extended controls.
- Debug APK: 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 your APK sources, you can link the source to the APK debug stream for a more faithful debugging process. Select Profile or Debug APK from the Android Studio home screen or File → Profile or Debug APK.
- Layout Inspector: better grouping of properties into common categories, search functionality in the view tree and property panels, and while an application is running you can access the layout inspector via Tools → Android → Layout Inspector.
- Device File Explorer: Ported from DDMS, the new Device File Explorer lets you view the file and directory structure of your Android device or emulator. When testing your app, you can now preview and quickly edit app data files directly in Android Studio.
- Android Profiler: The previous Android Monitor toolset has been rewritten and replaced with the Android Profiler. Once you’ve deployed your app to a running device or emulator, you can access a real-time, unified view of CPU, memory, and network activity for your app. Each of the performance events is mapped to the UI event timeline that highlights touch events, key presses, and activity changes. Click on each timeline to dig deeper into each aspect of your app’s performance.
- CPU Profiler: Analyze your application’s CPU thread usage by triggering a sample or an instrumented CPU trace. You can troubleshoot CPU performance issues using a variety of data views and filters.
- Memory Profiler: Combines the functionality of the old Heap Viewer and Allocation Tracker in a rich interface to help debug memory usage issues in your application. You can diagnose a range of memory issues by analyzing memory allocations, heap dumps, and more.
- Network Profiler: Monitor your application’s network activity, inspect the payload of each of your network requests, and link to the line of source code that generated the network request. Currently, the network profiler works with the HttpURLConnection, OkHttp, and Volley network libraries.
- APK Analyzer Improvements: Further optimize your APK file size by analyzing instant app zips and AARs, as well as viewing the dex bytecode of classes and methods. You can also generate Proguard configuration rules and load Proguard mapping files into the dex viewer.
Again, this is a very early preview of Android Studio 3.0. The good news is that you can install it next to your stable version. This is 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 will need Android Studio 3.0.