Category: Android Studio

Updating your games for modern Android

Android Developers July 20, 2018 Android, Android Studio, Google Play, Requirements

Posted by Tom Greenaway, Senior Partner Developer Advocate

Last year we announced that starting from August 2018 Google Play will require all new apps and games to target a recent Android API level – set to API level 26 (Android 8.0 Oreo), or higher. Additionally, this requirement will extend to updates for existing apps and games starting from November 2018.

Every new Android version introduces changes that bring significant security and performance improvements – and enhance the user experience of Android overall. Updating your games to target the latest API level ensures that your users can benefit from these improvements, while still allowing your games to run on older Android versions.

Simple next steps:

  • Install the Android 8.0 Oreo SDK (API level 26) via Android Studio by navigating to (Tools > Android > SDK Manager > Android SDK > SDK Platforms).
  • Update your game to target API level 26 and see whether your game has any incompatibilities or issues as soon as possible. Update any external dependencies as necessary. Learn more about the incremental changes between versions of Android here.
  • If you are using an advertising network, SDK or plugin which is incompatible with API level 26, reach out to your contacts and find out their timeline for supporting target API level 26. The sooner they’re aware of these changes the better.
  • If you build your game with Unity, support for target API 26 is built into Unity 5.6.6 and beyond. Simply ensure the latest target API level is selected in your Android build settings for Unity (Build Settings > Android > Player Settings). For versions of Unity 5.6.5 and prior, consult this documentation which includes a workaround for versions dating back to 4.3.
  • For games built with Unreal, check your Android platform settings has the “Target SDK Version” set to 26.
  • If you use Cocos2D-X, check the target API level in the gradle.properties file that is generated.

Significant changes to be aware of:

  • Since API 23, we have required permissions be requested at runtime which helps streamline the app install process.
  • Since API 24, apps can no longer dynamically link against non-NDK libraries. If your app (including third-party static libraries) contains native code, you should only be using public NDK APIs.
  • If your game uses Android push notifications, the Google Play Services SDK in your game will need to be updated to version 10.2.1 or above for your game to support API level 26.
  • If your game uses opaque binary blobs (OBB), then your game must check if it can access the directory before attempting to access the OBB files themselves. We recommend explicitly requesting permission for access using the Runtime Permissions API, and gracefully handling cases wherein the permission is not granted. Additionally, add an entry in the manifest for the external storage access:
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    

Moving ahead

Remember, updating the target API level is just the first step – make sure your game is compatible with the behavior changes between your current target API level and API level 26. Check out further guidance on the changes in past versions of Android to help in your migration process. These policy changes are important for moving the Android ecosystem forward and keeping it healthy for our users – and yours.

How useful did you find this blog post?

Android Emulator – AMD Processor & Hyper-V Support

Android Developers July 9, 2018 AMD, Android, Android Emulator, Android Studio, HyperV

Posted by Jamal Eason, Product Manager, Android

Since the major revamp of the Android Emulator two years ago, we have focused on delivering a fast and feature-rich emulator to help you build great app experiences for users. Today, the Android Emulator is the top device deployed to from Android Studio — more than 2x over physical Android devices. We are humbled to hear from many of you that the Android Emulator has come a long way, but we are not done yet.

Making the Android Emulator faster is one of the top priorities for the Android Studio team. Over the last few releases, we have launched quick boot & emulator snapshots for quickly starting and resuming emulator sessions in under 2 seconds. Up until now, our emulator experience has almost universally worked on macOS® and Linux computers. But for users of Microsoft® Windows® or the Microsoft® Hyper-V platform, our hardware accelerated speed enhancements for the Android Emulator only worked with computers with Intel® processors. Support for AMD® processors and Microsoft Hyper-V hypervisor are two long-standing user requests from the Android developer community that we are happy to address with this Android Emulator update.

Today, you can download the latest Android Emulator release, which is enabled to run x86 based Android Virtual Devices (AVD) on computers that use AMD processors. This exciting update makes the Android Emulator more accessible to a new set of Android app developers that were previously limited to software emulation, but can now have hardware accelerated performance. Moreover, for those of you who use Hyper-V to run your local app backend, the Android Emulator can now also coexist with other Hyper-V-backed applications on Windows® 10.

Thanks to a new Microsoft Windows Hypervisor Platform (WHPX) API and recent open-source contributions from Microsoft, even more Android app developers can take advantage of all the speed improvements and features in the Android Emulator.

Android Emulator running on Windows 10 with AMD Processor
Screenshot Configuration: Asus ROG Strix GL 702ZC, Processor: AMD® Ryzen 7 1700 Processor, Chipset: AMD 5350, Graphics: AMD® Radeon RX580

Support for these technologies was initially available in the v27.3.8 Android Emulator canary release and today we are releasing this set of preview features (AMD processor & Hyper-V support) on the stable channel for more feedback. Alongside this update, we have added additional speed improvements in loading emulator snapshots for those developers using the Intel® Hardware Accelerated Execution Manager (HAXM).

How to use

Linux

If you use Linux for Android app development, the Android Emulator will continue to use the native Kernel-based Virtual Machine (KVM) hypervisor for both Intel and AMD based computers for a fast and performant virtualization solution. An update to the v27.3.8 Android Emulator will offer you the new snapshots UI along with improvements to performance, reliability and resource usage.

macOS

For OS X v10.10 Yosemite and higher, the Android Emulator uses the built-in Hypervisor.Framework by default, and falls back to using the Intel Hardware Accelerated Execution Manager (HAXM) if Hypervisor.Framework fails to initialize (such as when running on OS X v10.9 or earlier). Once you update to the latest Android Emulator on macOS, you will also have access to the new snapshots UI along with under the hood performance and reliability improvements.

Android Emulator – Snapshots Extended Controls

Microsoft Windows

On Intel x86-based computers, the Android Emulator will continue to use Intel HAXM by default. Intel HAXM is a mature and open-sourced hypervisor solution developed by Intel. Thanks to on-going development by Intel, the fastest emulator performance on Windows is still with Intel HAXM. To download the latest Intel HAXM v7.2.0, check for updates in the Android SDK Manager.

If you have an AMD processor in your computer you need the following setup requirements to be in place:

  • AMD Processor – Recommended: AMD® Ryzen processors
  • Android Studio 3.2 Beta or higher – download via Android Studio Preview page
  • Android Emulator v27.3.8+ – download via Android Studio SDK Manager
  • x86 Android Virtual Device (AVD) – Create AVD
  • Windows 10 with April 2018 Update
  • Enable via Windows Features: “Windows Hypervisor Platform”

Windows Hypervisor Platform setting in Windows 10

If you want to use Hyper-V at the same time as the Android Emulator on your Intel processor-based computer, you will also need the same Android Studio and Android Emulator versions as listed above, but with the additional requirements:

  • Enable via Windows Features: “Hyper-V” – Only available for Windows 10 Professional/Education/Enterprise
  • Intel Processor : Intel® Core processor that supports Virtualization Technology (VT-x), Extended Page Tables (EPT), and Unrestricted Guest (UG) features. Additionally VT-x needs to be enabled in the BIOS.

For more setup tips and troubleshooting details, check out the documentation page.

Again, for existing Windows users who have an Intel-based processor, the Android Emulator will continue to use the faster and recommended Intel HAXM configuration. For those using AMD processors, and those who use Hyper-V hypervisors, this should be an exciting step forward to start using the Android Emulator.

Next Steps & Feedback

Download the latest Android Emulator from the Android Studio 3.2 Beta SDK Manager for the latest performance updates across all supported platforms that you are using. We are going to continue to invest in performance improvements for each of the platforms and we look forward to your feedback and feature requests.

If you find a bug or issue, feel free to file an issue. Connect with us — the Android Studio development team ‐ on our Google+ page or on Twitter.

Android Studio 3.2 Beta

Android Developers June 21, 2018 Android, Android Studio

Posted by Jamal Eason, Product Manager, Android

Starting today, you can download Android Studio 3.2 Beta. Previewed at Google I/O 2018, the latest release of the official Android IDE is focused on helping onboard you to all the new features launched around Google I/O — Android JetPack, Android P Developer Preview, and the new Android App Bundle format. There are also several other exciting new features included in Android Studio 3.2 to accelerate your app development, such as Emulator Snapshots and the Energy Profiler.

As the usage of Android Studio has grown in the 3.5 years since version 1.0, we have also become increasingly obsessed with quality. We continue to invest in quality because we know that millions of app developers spend almost everyday in Android Studio and need a reliable set of tools. Stability, build times, and other quality work will be the primary focus for our next release once we finish Android Studio 3.2. We also did not want to wait, so we have made checkins to address memory leaks and performance issues as well as fixed more than 450 bugs. Thank you for the continued feedback and please keep it coming so we can focus on the areas you care about most in the next version of Android Studio. If want to try out the latest features, and assess the improvements in quality, you can download Android Studio on the beta release channel.

What is inside of Android Studio 3.2

Building on the canary release of Android Studio 3.2, the Beta release includes:

  • Android App Bundle support – The Android App Bundle is a new publishing format that uses the Google Play’s Dynamic Delivery, which delivers a smaller, optimized APK that only contains the resources needed for a specific device. Without any code changes, you can take advantage of the app size savings of an Android App Bundle by navigating to Build Build Bundle / APK or BuildGenerate Signed Bundle / APK.

Build Android App Bundle

  • Emulator Snapshots – With Android Studio 3.2 you can create snapshots at any emulator state and then start a snapshot in under 2 seconds. You can pre-configure an Android Virtual Device (AVD) snapshot with the apps, data and settings that you want and then repeatedly go back to the same snapshot. Learn more.

Android Emulator Snapshots

  • Energy Profiler – The new Energy Profiler in the performance profiler suite can help you understand the energy impact of your app on an Android device. You can now visualize the estimated energy usage of system components, plus inspect background events that may contribute to battery drain.

Energy Profiler

Check out the full write-up of all the major features organized by development flow listed below and on the canary blog:

Develop

  • Navigation Editor
  • AndroidX Refactoring
  • Sample Data
  • Material Design Update
  • Android Slices
  • CMakeList editing
  • What’s New Assistant
  • New Lint Checks
  • Intellij Platform Update

Build

  • Android App Bundle
  • D8 Desugaring
  • R8 Optimizer

Test

  • Android Emulator Snapshots
  • Screen Record in Android Emulator
  • Virtual Scene Android Emulator Camera
  • ADB Connection Assistant

Optimize

  • Energy Profiler
  • System Trace
  • Profiler Sessions
  • Automatic CPU Recording
  • JNI Reference Tracking

Sessions at Google I/O ’18

With the release of Android Studio 3.2 at Google I/O ’18, the Android Studio team also presented a series of sessions about Android Studio. Watch the following videos to see the latest features in action and to get tips & tricks on how to use Android Studio:

Download & Feedback

Download the latest version of Android Studio 3.2 from the beta channel download page. If you are using a previous versions of Android Studio, make sure you update to Android Studio Beta 1 or higher. If you also want to maintain a stable version of Android Studio, you can run the stable release version and beta release versions of Android Studio at the same time. Learn more.

To use the mentioned Android Emulator features make sure you are running at least Android Emulator v27.3+ downloaded via the Android Studio SDK Manager.

Please note, to ensure we maintain product quality, some of the features you saw in the canary channel like Navigation Editor are not enabled by default. To turn on canary release channel features go to File → Settings → Experimental → Editor → Enable Navigation Editor.

If you find a bug or issue, feel free to file an issue. Connect with us — the Android Studio development team ‐ on our Google+ page or on Twitter.

Android Studio 3.2 Canary

Android Developers May 8, 2018 Android Studio, androidstudio, Featured

Today at Google I/O 2018 we announced the latest preview of Android Studio 3.2 which includes an exciting set of features that support the Android P Developer Preview, the new Android App Bundle, and Android Jetpack. Download Android Studio 3.2 from our canary release channel today to explore one of the most feature rich releases of the year.

Android Jetpack is a set of libraries, developer tools and architectural guidance to help make it quick and easy to build great Android apps. It provides common infrastructure code so you can focus on what makes your app unique. Android Studio 3.2 includes a wide set of tools that support Jetpack from a visual Navigation Editor that uses the Navigation API, templates for Android Slices APIs, to refactoring tools to migrate to the new Android support libraries in Jetpack — AndroidX.

The canary 14 release of Android Studio 3.2 also supports the new Android app model that is the evolution of the APK format, the Android App Bundle. With no code changes, Android Studio 3.2 will help you create a new Android App Bundle and have it ready for publishing on Google Play.

There are 20 major features in this release of Android Studio spanning from ultra fast Android Emulator Snapshots, Sample Data in the Layout Editor, to a brand new Energy Profiler to measure battery impact of your app. If any of these features sound interesting, download the preview of Android Studio 3.2 today.

To see these features demoed in action and to get a sneak peak at other features we are working on, check out the Google I/O 2018 session – What’s new in Android Development Tools.

What’s new in Android Development Tools – Google I/O 2018

Below is a full list of new features in Android Studio 3.2, organized by key developer flows.

Develop

  • Navigation Editor – As a part of Jetpack, Android Studio 3.2 features a new way to design the navigational structure between the screens of your app. The navigation editor is a visual editor which allows you to construct XML resources that support using the new Navigation Component in Jetpack.

Navigation Editor

  • AndroidX Refactoring Support – One of the components of Jetpack is rethinking and refactoring the Android Support Libraries to a new Android extension library (AndroidX) namespace. As a part of the early preview of the AndroidX, Android Studio 3.2 helps you through this migration with a new refactoring action. To use the feature, navigate to: RefactorRefactor to AndroidX. As an additional enhancement to the refactoring process, if you have any maven dependencies that have not migrated to the AndroidX namespace, the Android Studio build system will automatically convert those project dependencies as well. You can manually control the conversion process by toggling the android.enableJetifier = true flag in your gradle.properties file. While the refactoring action supports common project configurations, we recommend that you save a backup of your project before you refactor. Learn more.

AndroidX Refactoring Support

  • Sample Data – Many Android layouts have runtime data that can make it difficult to visualize the look and feel of a layout during the design stage of app development. Sample Data in the Layout Editor allows you to use placeholder data to aid in the design of your app. From RecyclerView, ImageView to TextView, you can add built-in sample data to populate these views via a popup-window in the Layout Editor. To try out the feature, add a RecyclerView to a new layout, and then click on the new tools design-time attributes icon and choose a selection out of the carousel of sample data templates.

Design Time Sample Data

  • Material Design Update – Material Design continues to evolve not only as a design system but also in implementation on Android. When you start migrating from the Android Design support library to the new MaterialComponents app theme and library, Android Studio 3.2 will offer you access to new and updated widgets such as BottomAppBar, buttons, cards, text fields, new font styles and more. Learn more.

New Material Design Components

  • Slices support – Slices is a new way to embed portions of your app content in other user interface surfaces in the Android operating system. Slices is backwards compatible to Android 4.4 KitKat (API 19) and will enable you to surface app content in Google Search suggestions. Android Studio 3.2 has a built in template to help you extend your app with the new Slice Provider APIs as well as new lint checks to ensure that you’re following best practices when constructing the slices. To get started right-click on a project folder, and navigate to NewOtherSlice Provider. Learn how to test your slice interactions by checking out the getting started guide.

Slices Provider Template

  • CMakeList Editing Support – Android Studio supports CMake build scripts for your app’s C/C++ code. With this release of Android Studio 3.2, code completion and syntax highlighting now works on common CMakeList commands.

CMakeList Code Completion

  • What’s New Assistant Android Studio 3.2 has a new assistant panel that opens automatically after an update to inform you about the latest changes to the IDE. You can also open the panel by navigating to Help → What’s New in Android Studio.

What’s New Assistant

  • IntelliJ Platform Update – Android Studio 3.2 includes the IntelliJ 2018.1 platform release, which has many new features such as data flow analysis, partial Git commits support, and a ton of new code analysis enhancements. Learn more.

Build

  • Android App Bundle The Android App Bundle is the new app publishing format designed to help you deliver smaller APKs to your users. Google Play has a new Dynamic Delivery platform that accepts your Android App Bundle, and delivers only the APKs that you need on a specific device. Android Studio 3.2 enables you to create and test an Android App Bundle. As long as you are running the latest Android Gradle plugin (com.android.tools.build:gradle:3.2.0-alpha14), you can rebuild your code as an app bundle and get the benefit of smaller APKs based on language, screen density, and ABIs with no changes to your app code. To get started, navigate to Build Build Bundle / APK or BuildGenerate Signed Bundle / APK Learn more.

Build Android App Bundle

  • D8 Desugaring – In some cases, new Java Language features require new bytecodes and language APIs, however older Android devices may not support these features. Desugaring allows you to use these features on older devices by replacing new bytecodes and language APIs with older ones during the build process. Desugaring was initially introduced with Android Studio 3.0 as a separate tool, and in Android Studio 3.1, we integrated the desugaring step into the D8 tool as an experimental feature, reducing overall build time. Now D8 desugaring is turned on by default for Android Studio 3.2. You can you can now use most of the latest language changes while targeting older devices.
  • R8 Optimizer – During the app build process, Android Studio historically used ProGuard to optimize and shrink Java language bytecode. Starting with Android Studio 3.2, we are starting the transition to use R8 as a replacement to ProGuard. To experiment with R8, add android.enableR8=true to your gradle.properties file. R8 is still experimental, so we do not recommend publishing your app using R8 yet. Learn more.

Enable R8 in Android Studio

Test

  • Emulator Snapshots With Quickboot in the Android Emulator we enabled you to launch the emulator in under 6 seconds. With Android Studio 3.2 we have extended this feature to enable you to create snapshots at any emulator state and start them iun under 2 seconds. When testing and developing your app, you can pre-configure an Android Virtual Device (AVD) snapshot with the presets, apps, data and settings that you want in-place, and repeatedly go back to the same snapshot. Snapshots load in under 2 seconds and you can launch to specific snapshots from the Android Emulator Extended Controls panel, the command-line ( ./adb emu avd snapshot load snap_2018-04-29_00-01-12 ) or from within Android Studio.

Android Emulator Snapshots

  • Screen Record in Android Emulator Normally creating a screen recording of your app screen would only work for Android 4.4 KitKat (API 19) and above with no audio, with limited Android Emulator support. With the latest Android Emulator (v27.3+), you can take screen recordings on any API level with audio. Plus, there is a built-in conversion to output to GIF and WebM. You can trigger the new screen record feature via the Android Emulator Extended Controls panel, command line ( ./adb emu screenrecord start --time-limit 10 /sample_video.webm ), and from Android Studio.

Screen record in Android Emulator

  • Virtual Scene Camera for Android Emulator – Developing and testing apps with ARCore is now even easier with the new Virtual Scene camera, which allows you to iterate on your augmented reality (AR) experience within a virtual environment. The emulator is calibrated to work with ARCore APIs for AR apps and allows you to inject virtual scene bitmap images. The virtual scene camera can also be used as a regular HAL3 compatible camera. Open the built-in Android camera app inside the Android Emulator to get started. By default, the new virtual scene camera is the rear camera for new Android Virtual Devices created with Android Studio 3.2. Learn more.

Virtual Scene Camera in Android Emulator

  • ADB Connection Assistant – To help troubleshoot your Android device connections via ADB, Android Studio 3.2 has a new assistant. The ADB Connection Assistant walks you through common troubleshooting steps to connect your Android device to your development machine. You can trigger the assistant from the Run Dialogue box or by navigating to ToolsConnection Assistant .

ADB Connection Assistant

Optimize

  • Energy Profiler Battery life is a key concern for many phone users, and your app may impact battery life more than you realize. The new Energy Profiler in the performance profiler suite can help you understand the energy impact of your app on an Android device. You can now visualize the estimated energy usage of system components, plus inspect background events that may contribute to battery drain. To use the energy profiler, ensure you are connected to an Android device or emulator running Android 8.0 Oreo (API 26) or higher. Learn more.

Energy Profiler

  • System Trace The new System Trace feature in the CPU Profiler allows you to inspect how your app interacts with system resources in fine-grained detail. Inspect exact timings and durations of your thread states, visualize where your CPU bottlenecks are across all cores, and add custom trace events to analyze. To use system trace, start profiling your app, click into the CPU Profiler, and then choose the System Trace recording configuration. Learn more.

System Trace

  • Profiler Sessions We now automatically save Profiler data as “sessions” to revisit and inspect later while you have Android Studio open. We’ve also added the ability to import and export your CPU recordings and heap dumps for later analysis or inspection with other tools.

Profiler Sessions

  • Automatic CPU Recording – You can now automatically record CPU activity using the Debug API. After you deploy your app to a device, the profiler automatically starts recording CPU activity when your app calls startMethodTracing(String tracePath), and stops recording when your app calls stopMethodTracing(). Similarly, you can also now automatically start recording CPU activity on app start-up by enabling this option in your run configuration.
  • JNI Reference Tracking – For those of you who have C/C++ code in your Android app, Android Studio 3.2 now allows you to inspect the memory allocations of your JNI code in the Memory Profiler. As long as you deploy your app to a device running Android 8.0 Oreo (API 26) and higher, you can drill down into the allocation call stack from your JNI reference. To use the feature, start a memory profiler session, and select the JNI Heap from the Live Allocation drop-down menu.

JNI Reference Tracking

To recap, the latest canary of Android Studio 3.2 includes these new major features:

Develop

  • Navigation Editor
  • AndroidX Refactoring
  • Sample Data
  • Material Design Update
  • Android Slices
  • CMakeList editing
  • What’s New Assistant
  • New Lint Checks
  • Intellij Platform Update

Build

  • Android App Bundle
  • D8 Desugaring
  • R8 Optimizer
Test

  • Android Emulator Snapshots
  • Screen Record in Android Emulator
  • Virtual Scene Android Emulator Camera
  • ADB Connection Assistant

Optimize

  • Energy Profiler
  • System Trace
  • Profiler Sessions
  • Automatic CPU Recording
  • JNI Reference Tracking

Check out the preview release notes for more details.

Getting Started

Download

Download the latest version of Android Studio 3.2 from the canary channel download page. If you are using a previous canary release of Android Studio, make sure you update to Android Studio Canary 14 or higher. If you want to maintain a stable version of Android Studio, you can run the stable release version and canary release versions of Android Studio at the same time. Learn more.

To use the mentioned Android Emulator features make sure you are running at least Android Emulator v27.3+ downloaded via the Android Studio SDK Manager.

We appreciate any early feedback on things you like, and issues or features you would like to see. Please note, to ensure we maintain product quality, the features you see in the canary channel may not be available in the next stable release channel until they are ready for stable usage. If you find a bug or issue, feel free to file an issue. Connect with us — the Android Studio development team ‐ on our Google+ page or on Twitter.

Android Studio 3.1

Android Developers March 26, 2018 Android, Android Studio

Posted by Jamal Eason, Product Manager, Android

We are excited to announce that Android Studio 3.1 is now available to download in the stable release channel. The focus areas for this release are around product quality and app development productivity. In addition to many underlying quality changes, we added several new features into Android Studio 3.1 that you should integrate into your development flow.

New to Android Studio 3.1 is a C++ performance profiler to help troubleshoot performance bottlenecks in your app code. For those of you with a Room or SQLite database in their your app, we added better code editor support to aid in your SQL table and query creation statements. We also added better lint support for your Kotlin code, and accelerated your testing with an updated Android Emulator with Quick Boot. If any of these features sound exciting or you are looking for the next stable version of Android Studio, you should download Android Studio 3.1 today!

Check out the list of new features in Android Studio 3.1 below, organized by key developer flows.

What’s new in Android Studio 3.1

Develop

  • Kotlin Lint Checks Since announcing official Kotlin language support last year on the Android platform, we continue to invest in Kotlin language support in Android Studio. In Android Studio 3.1, we enhanced the Lint code quality checks so that now you can run them via the command line as well as from the IDE. Just open a Android Studio project, and run gradlew lint via command line. Learn more.

Kotlin Lint checks via command line

  • Database Code Editing Editing inline SQL/Room Database code in your Android project is now even easier with Android Studio 3.1. This release has SQL code completion in your @Query declarations, better SQL statement refactoring, and SQL code navigation across your project. Learn more.

Room Database code completion

  • IntelliJ Platform Update: Android Studio 3.1 includes the IntelliJ 2017.3.3 platform release, which has many new features such as new Kotlin language intentions and built-in support for SVG image preview. Learn more.

Build

  • D8 Dex Compiler D8 is now the default dex compiler in Android Studio 3.1. Replacing the legacy DX compiler, D8 dexing is an under the hood APK compilation step that makes your app size smaller, enables accurate step debugging, and many times leads to faster builds. Ensure that your gradle.properties either has no android.enableD8 flag, or if it does ensure that it is set to true. Learn more.
  • New Build Output Window – Android Studio 3.1 has an updated Build output window which organizes build status and errors in a new tree view. This change also consolidates the legacy Gradle output into this new window. Learn more.

New Build Output Window

Test

  • Quick Boot Quick Boot allows you to resume your Android Emulator session in under 6 seconds. Slow start time on the Android Emulator was a major pain point we heard from you and Quick Boot solves this issue. Like a physical Android device, the emulator must perform an initial cold boot, but subsequent starts are fast. The feature is enabled by default for all Android Virtual Devices. Additionally, in this release, you have finer grain controls of when to use Quick Boot and the ability to save the quick boot state on demand under the emulator settings page. Learn more of other top Android Emulator Features.

Quick Boot On Demand Setting

  • System Images and Frameless Device Skins – The latest version of the Android Emulator now supports the Google Play Store and Google APIs on API 24 (Nougat) – API 27 (Oreo) emulator systems images as well as the P Developer Preview. Additionally the device emulator skins are updated to work in a new frameless mode, which can help you test your app with 18:9 screen aspect ratios, or Android P Developer Preview DisplayCutout APIs. Learn more.

Window frameless mode in the Android Emulator

Optimize

  • C++ CPU Profiling Last year with Android Studio 3.0, we launched a brand new set of Android profilers to measure the CPU, Memory, and Network Activity in your app. With Android Studio 3.1, in addition to performance profiling your Kotlin and Java language app code, you can now profile your C++ code in your app. Using simpleperf as backend, the C++ profiler allows you to record C++ method traces. Learn more.

C++ CPU Profiler

  • Network Profiler Updates: Threads & Network Request To aid with analyzing network traffic in your app, we added a new Network Thread view to inspect multithreaded network traffic, and we also added a new Network Request tab to dig into the network requests over time. With these updates to the Network Profiler you will have additional tools to trace the network traffic from each thread and network request all the way down through the network call stack. Learn more.

Network Profiler with thread support

To recap, Android Studio 3.1 includes these new major features:

Develop

  • Kotlin Lint Checks
  • Database Code Editing
  • IntelliJ Platform Update

Build

  • D8 Dex Compiler
  • New Build Output Window

Test & Debug

  • Quick Boot for Android Emulator
  • API 27 with Google Play Emulator System Images
  • Window frameless mode for Android Emulator

Optimize

  • C++ Profiler
  • Network Profiler – Thread Support
  • Network Profiler – Request Support

Check out the release notes for more details.

Getting Started

Download

If you are using a previous version of Android Studio, you can upgrade to Android Studio 3.1 today or you can download the update from the official Android Studio download page.

We appreciate any feedback on things you like, issues or features you would like to see. If you find a bug or issue, feel free to file an issue. Connect with us — the Android Studio development team ‐ on our Google+ page or on Twitter.

Quick Boot & the Top Features in the Android Emulator

Android Developers December 18, 2017 Android, Android Emulator, Android Studio

Posted by Jamal Eason, Product Manager, Android

Today, we are excited to announce Quick Boot for the Android Emulator. With
Quick Boot, you can launch the Android Emulator in under 6 seconds. Quick Boot
works by snapshotting an emulator session so you can reload in seconds. Quick
Boot was first released with Android Studio 3.0 in the canary update channel and
we are excited to release the feature as a stable update today.

In addition to this new feature, we also wanted to highlight some of the top
features from recent releases. Since the complete revamp of the Android Emulator
two
years ago
, we continue to focus on improving speed, stability and adding a
rich set of features that accelerate your app development and testing. With all
the recent changes, it is definitely worth updating to the latest version of the
Android Emulator to use it today.

Top 5 Features

  • Quick Boot – Released as a stable feature today, Quick Boot
    allows you to resume your Android Emulator session in under 6 seconds. The first
    time you start an Android Virtual Device (AVD) with the Android Emulator, it
    must perform a cold boot (just like powering on a device), but subsequent starts
    are fast and the system is restored to the state at which you closed the
    emulator last (similar to waking a device). We accomplished this by completely
    re-engineering the legacy emulator snapshot architecture to work with virtual
    sensors and GPU acceleration. No additional setup is required because Quick Boot
    is enabled by default starting with Android Emulator v27.0.2.

Quick Boot in the Android Emulator

  • Android CTS Compatibility With each
    release of the Android SDK, we ensure that the Android Emulator is ready for
    your app development needs, from testing backwards compatibility with Android
    KitKat to integrating the latest APIs of the developer preview. To increase
    product quality and reliability of emulator system images, we now qualify final
    Android System Image builds from Android Nougat (API 24) and higher against the
    Android Compatibility Test
    Suite
    (CTS)—the same testing suite that official Android physical devices
    must pass.
  • Google Play Support We know that many
    app developers use Google Play Services, and it can be difficult to keep the
    service up to date in the Android Emulator system images. To solve this problem,
    we now offer versions of Android System Images that include the Play Store app.
    The Google Play images are available starting with Android Nougat (API 24). With
    these new emulator images, you can update Google Play Services via the Play
    Store app in your emulator just as you would on a physical Android device. Plus,
    you can now test end-to-end install, update, and purchase flows with the Google
    Play Store.
  • Performance Improvements Making the
    emulator fast and performant is an on-going goal for our team. We continuously
    look at the performance impact of running the emulator on your development
    machine, especially RAM usage. With the latest versions of the Android Emulator,
    we now allocate RAM on demand, instead of allocating and pinning the memory to
    the max RAM size defined in your AVD. We do this by tapping into the native
    hypervisors for Linux (KVM) and macOS® (Hypervisor.Framework), and an
    enhanced Intel® HAXM (v6.2.1 and higher) for Microsoft®
    Windows®, which uses the new on-demand memory allocation.
  • Additionally, over the last several releases, we have improved CPU and I/O
    performance while enhancing GPU performance, including OpenGL ES 3.0 support.
    Looking at a common task such as ADB push highlights the improvements in the
    Android CPU and I/O pipelines:

    ADB Push Speed Comparison with Android Emulator

    For GPU performance, we created a sample GPU emulation stress
    test app
    to gauge improvements over time. We found that the latest emulator
    can render higher frame rates than before, and it is one of the few emulators
    that can render OpenGL ES 3.0 accurately per the Android specification.

GPU Emulation Stress Test – Android App

GPU Emulation Stress Test with Android Emulator

More Features

In addition to these major features, there are a whole host of additional
features that we have added to the Android Emulator over the last year that you
may not be aware of:

  • Wi-Fi support – Starting with API 24 system images, you can
    create an AVD that both connects to a virtual cellular network and a virtual
    Wi-Fi Access Point.
  • Google Cast support – When using a Google Play system
    image, you can cast screen and audio content to Chromecast devices on the same
    Wi-Fi network.
  • Drag and drop APKs & files – Simply drag an APK onto the
    Android Emulator window to trigger an app install. Also you can drag any other
    data file and find it in the /Downloads folder in your Android Virtual Device.
  • Host copy & paste – You can copy & paste text between the
    Android Emulator and your development machine.
  • Virtual 2-finger pinch & zoom – When interacting with apps
    like Google Maps, hold down the Ctrl Key (on Microsoft®
    Windows® or Linux) or ⌘ (on macOS® ) , and a finger
    overlay appears on screen to aid with pinch & zoom actions.
  • GPS location – Manually select a GPS point or set of GPS
    points under the Location tab of the Android Emulator.
  • Virtual sensors – There is a dedicated page in the extended
    controls panel that has supported sensors in the Android Emulator including
    acceleration, rotation, proximity and many more.
  • WebCam support – You can use a webcam or your laptop
    built-in webcam as a virtual camera in the AVD. Validate your AVD camera
    settings in the Advanced Settings page in the AVD Manager.
  • Host machine keyboard – You can use your real keyboard to
    enter text into the Android Virtual Device.
  • Virtual SMS and phone calls – In the extended controls
    panel, you can trigger a virtual SMS or phone call to test apps with telephony
    dependencies.
  • Screen zooming – On the main toolbar, click on the magnify
    glass icon to enter zoom mode, and then select a region of the screen you want
    to inspect.
  • Window resizing – Simply drag a corner of the Android
    Emulator window to change to the desired size.
  • Network proxy support – Add a custom HTTP proxy for your
    Android Emulator session by going to the Settings page under the Proxy tab.
  • Bug reporting – You can quickly generate a bug report for
    your app by using the Bug Report section in the extended controls panel to share
    with your team or to send feedback to Google.

Learn more about the Android Emulator in the Emulator
documentation
.

Getting Started

All of these features and improvements are available to download and use now
with Android Emulator v27.0.2+, which you can get via the SDK Manager in Android
Studio. For a fast experience, we recommend creating and running the x86 version
of emulator system images, with the latest Android Emulator, Intel® HAXM (if
applicable) and graphics drivers installed.

We appreciate any feedback on things you like, issues or features you would like
to see. If you find a bug, issue, or have a feature request feel free to file
an issue
. We are definitely not done, but we hope you are excited about the
improvements so far.

Android Studio 3.0

Android Developers October 25, 2017 Android, Android Studio, Develop, Featured

Posted by Jamal Eason, Product
Manager, Android

Android Studio 3.0 is ready to download today. Announced at Google I/O 2017,
Android Studio 3.0 is a large update focused on accelerating your app
development on Android.

This release of Android Studio is packed with many new updates, but there are
three major feature areas you do not want to miss, including: a new suite of app
profiling tools to quickly diagnose performance issues, support for the Kotlin
programming language, and a new set of tools and wizards to accelerate your
development on the latest Android Oreo APIs.

We also invested time in improving stability and performance across many areas
of Android Studio. Thanks to your feedback during the preview versions of
Android Studio 3.0! If you are looking for high stability, want to build high
quality apps for Android Oreo, develop with the Kotlin language, or use the
latest in Android app performance tools, then you should download Android Studio
3.0 today.

Check out the the list of new features in Android Studio 3.0 below, organized by
key developer flows.


What’s new in Android Studio 3.0

Develop

  • Kotlin Programming Language As announced
    at Google I/O 2017
    , the Kotlin
    programming language is now officially supported for Android development. Kotlin
    is an expressive and concise language that is interoperable with existing
    Android languages and runtimes, which means you can use as little or as much of
    the language in your app as you want. Kotlin is a production-ready language
    used by many popular Android apps on Google Play today.

    This release of Android Studio is the first milestone of bundles the Kotlin
    language support inside the IDE. Many of your favorite features such as code
    completion and syntax highlighting work well this release and we will continue
    to improve the remaining editor features in upcoming release. You can choose to
    add Kotlin to your project using the built-in conversion tool found under
    CodeConvert Java File to Kotlin File, or
    create a Kotlin enabled project with the New Project Wizard. Lean more about
    Kotlin language support
    in Android Studio
    .

Kotlin Language Conversion in Android Studio

  • 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 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. Learn
    more
    .

Build

  • Build Speed Improvements To further
    improve the speed of Gradle for larger scale projects with many modules, we
    introduced a rare breaking API change in the Android Gradle Plugin to
    improve scalability and build times. This change is one of reasons we jumped
    version numbers from Android Studio 2.4 to 3.0. If you depend on APIs provided
    by the previous Gradle plugin you should validate compatibility with the new
    plugin and migrate to the new APIs. To test, update the plugin version in your
    build.gradle file. Learn
    more
    .
  • Google’s Maven Repository To facilitate
    smaller and faster updates, Android Studio 3.0 utilizes Google’s Maven
    Repository by default instead of using the Android SDK Manager to find updates
    to Android Support Library, Google Play Services, and Firebase Maven
    dependencies. Used in combination with the latest command line SDK
    Manager tool
    and Gradle,
    Continuous Integration builds should migrate to Google’s Maven Repository for
    future Maven repository updates. Learn
    more
    .

Test & Debug

  • Google Play System Images We also
    updated the emulator system images for Android Oreo to now include the Google
    Play Store. Bundling in the Google Play store allows you to do end-to-end
    testing of apps with Google Play, and provides a convenient way to 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.

    Google Play Store in Android Emulator

    To ensure app security and a consistent experience with physical devices, the
    emulator system images with the Google Play store included are signed with a
    release key. This means you will not be able to get elevated privileges. If you
    require elevated privileges (root) to aid with your app troubleshooting, you can
    use the Android Open Source Project (AOSP) emulator system images that do not
    include Google apps or services. Learn more.

  • OpenGL ES 3.0 Support in Android Emulator
    The latest version of the Android Emulator has OpenGL ES 3.0 support
    for Android Oreo system images along with significant improvements in OpenGL ES
    2.0 graphics performance for older emulator system images. Learn
    more
    .
  • App Bug Reporter in Android Emulator To
    help in documenting bugs in your app, we have added an easier way to generate a
    bug report with the Android Emulator with all the necessary configuration
    settings and space to capture your repro steps. Learn
    more
    .
  • Proxy Support in Android If you use a
    proxy to access the Internet, we have added a user interface to manage the HTTP
    proxy settings used by the emulator. Lean
    more
    .
  • Android Emulator Quick Boot (Canary) One
    of the most common pain points we hear is that the emulator takes too long to
    boot. To address this concern, we are excited to preview a new feature to solve
    this called Quick Boot, which significantly speeds up your emulator start time.
    Once enabled, the first time you start an AVD a cold boot will occur (just like
    powering on a device), but all subsequent starts are fast and the system is
    restored to the state at which you closed the emulator (similar to waking a
    device). If you want to try it out, ensure you are on the canary update release
    channel and then you will find v26.2.0 of the Android Emulator in the SDK
    Manager. Learn
    more
    .
  • APK Debugging Android Studio 3.0 allows
    you to debug an arbitrary APK. This functionally is especially helpful for those
    who develop your Android C++ code in another IDE, but want to debug and analyze
    the APK in the context of Android Studio. As long as you have a debuggable
    version of your APK, you can use the new APK Debugging features to analyze,
    profile & debug the APK. Moreover, 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. Get started by simply selecting Profile or debug
    APK
    from the Android Studio Welcome Screen or File → Profile or
    debug APK
    . Learn
    More
    .

APK Debugging

  • Layout Inspector In this release we have
    added a few additional enhancements for the Layout Inspector including better
    grouping of properties into common categories, as well as search functionality
    in both the View Tree and Properties Panels. Learn
    more
    .
  • Device File Explorer The new Device File
    Explorer in Android Studio 3.0 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.
    Learn
    more
    .
  • Android Test Orchestrator Support – When used with
    AndroidJUnitRunner 1.0 or higher, the Android Gradle plugin 3.0 supports the use
    of the Android Test Orchestrator. The Android Test Orchestrator allows each of
    your app’s tests to run within its own Instrumentation.
    Learn
    more
    .

Optimize

  • Android Profiler Android Studio 3.0
    includes a brand new suite of tools to help debug performance problems in your
    app. We completely rewrote the previous set of Android Monitor tools, and
    replaced them with the Android Profiler. Once you deploy your app to a running
    device or emulator, click on the Android Profiler tab and you
    will now have access to a real-time & 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 so
    that you have more context on when and why a certain event happened. Click on
    each timeline to dig into each performance aspect of your app. Learn
    more
    .

Android Profiler – Combined timeline view.

CPU Profiler


Memory Profiler


Network Profiler

  • APK Analyzer Improvements We also
    updated APK Analyzer with additional enhancements to help you further optimize
    the size of your APK. Learn
    more
    .

To recap, Android Studio 3.0 includes these new major features:

If you are using a previous version of Android Studio, you can upgrade to
Android Studio 3.0 today or you can download the update from the official
Android Studio Preview download
page
. As mentioned in this blog, there are some breaking Gradle Plugin API
changes to support new features in the IDE. Therefore, you should also update
your Android Gradle plugin version to 3.0.0 in your current project to test and
validate your app project setup.

We appreciate any feedback on things you like, issues or features you would like
to see. If you find a bug or issue, feel free to file an
issue
. Connect with us — the Android Studio development team ‐ on our Google+ page or on Twitter

Page 1 of 1
Scroll Up