Tag Archives: Android Studio

Android Studio Arctic Fox (2020.3.1) Beta

Posted by Paris Hsu, Product & Design, Android

Android Studio Arctic Fox splash screen

Android Studio Arctic Fox splash screen

Note: As we announced late last year, we've changed our version numbering scheme to match the number for the IntelliJ IDE that Android Studio is based on, 2020.3, plus our own patch number, as well as a handy code name to make it easier to remember and refer to. We'll be using code names in alphabetical order; the first is Arctic Fox, now in beta, and the next is Bumblebee, now in canary.

Today, we are excited to unveil Android Studio Arctic Fox (2020.3.1) Beta ❄️?: the latest release of the official Android IDE focuses on Design, Devices, and Developer Productivity. It is available for download now on the beta channel for you to try out all the new features launched this week during Google I/O 2021!

Inspired by developer communities around the world, who despite having to adjust to challenges this past year still continue to create amazing and innovative apps, we have delivered and updated the suite of tools to empower three major themes:

  • Rapid UI design - with Jetpack Compose, it's never been easier to create modern UIs, and we have tools to help complete that journey: you can create previews in different configurations and navigate your code with Compose Preview, test it in isolation with Deploy Preview to Device, and inspect the full app with Layout inspector. Throughout iterations, you can quickly edit strings and numbers and see immediate updates. Moreover, with the Accessibility Scanner in Layout Editor, your View based layouts are audited for accessibility problems.
  • New devices, both large and small - reimagine and extend your app beyond phones--whether it's for Wear OS, Google TV, or Android Auto, we have prepared new emulators and system images, and even authentic simulations for different testing scenarios: pair your watch and phone emulators with Wear OS Pairing, take a virtual run with Wear OS heart rate sensors, switch channels with GoogleTV Remote Control, and drive with Automotive OS Sensor Replay.
  • Developer productivity boost - we want to ensure your workspace and environment are ready for the latest systems and optimized for speed and quality. Now you can enjoy a whole slew of new features and improvements that come with a major update to Intellij 2020.3, test your app with what Android 12 has to offer, improve your app performance with the updated UI for Memory Profiler, understand background task relationships with WorkManager Inspector, and use Non-Transitive R classes IDE Refactoring to increase build speed.

In short, this is an upgrade you do not want to miss! ✨ There are many more features and improvements surrounding these themes you can find in this Beta version, so read or watch below for further highlights. Or, skip the reading, download Android Studio Arctic Fox (2020.3.1) Beta in the beta channel and try out the latest features yourselves today! Give us feedback and help us to continue to focus on the areas you care about most in the next version of Android Studio.

What's new in Android development tools (I/O 2021)


What’s in Android Studio Arctic Fox (2020.3.1) Beta

Below is a full list of new features in Android Studio Arctic Fox (2020.3.1) Beta, organized by the three major themes:

Design

  • Compose Preview - You can create previews of your Compose UI with Compose Preview! By using the @Preview annotation, Compose previews can be made to visualize multiple components at once in different configurations (i.e themes, device) as well as create a mental mapping for you to navigate your code.
Compose Preview

Compose Preview

  • Layout Inspector for Compose - You can now inspect layouts written in Compose with Layout Inspector. Whether your app uses layouts fully written in Compose or layouts that use a hybrid of Compose and Views, the Layout Inspector helps you understand how your layouts are rendered on your running device or emulator, obtain rich details (such as parameters and modifiers passed to each composable), and debug issues that might arise. As you interact with the app, you now also have the option to either enable Live Updates to constantly stream data from your device, or reduce performance impact on your device by disabling live updates and clicking the Refresh action as needed.
Compose Layout Inspector

Compose Layout Inspector

  • Deploy Preview to Device - Use this feature to deploy a snippet of your UI to a device or emulator. This will help to test small parts of your code in the device without having to start the full application. Your preview will benefit the same context (permissions, resources) as your application. You can click the Deploy to device icon on the top of any Compose preview or next to the @Preview annotation in the code editor gutter and Android Studio will deploy that @Preview to your connected device or emulator.
Using Deploy to device from preview and gutter icon

Using Deploy to device from preview and gutter icon

  • Live Edit of literals - Live Editing of literals allows developers using Compose to quickly edit literals (strings, numbers, booleans) in their code and see the results immediately without needing to wait for compilation. The goal of the feature is to increase your productivity by having code changes appear near instantaneously in the previews, emulator, or physical device.
Editing numbers and strings update immediately in the preview and on device

Editing numbers and strings update immediately in the preview and on device

  • Accessibility Scanner for Layout Editor - Android Studio now integrates with the Android Accessibility Test Framework to help you find accessibility issues in your layouts. When using the Layout Editor, click on the error report button to launch the panel. The tool will report accessibility related issues and also offers suggested fixes for some common problems (e.g. missing content descriptions, or low contrast)
Accessibility Test Framework Scanner in Layout Editor

Accessibility Test Framework Scanner in Layout Editor

Devices

  • Wear OS Pairing - We created a new Wear OS pairing assistant to guide developers step by step through pairing Wear OS emulators with physical or virtual phones directly in Android Studio! You can start by going to device dropdown > Wear OS emulator pairing assistant. Note that this will currently pair with Wear OS 2 companion, and Wear OS 3 will be coming soon. Learn more.
Wear OS emulator pairing assistant dialog

Wear OS emulator pairing assistant dialog

Phone + Watch emulators paired successful state

Phone + Watch emulators paired successful state

  • New Wear OS system images - a developer preview of the Wear OS 3 system image is now available so that you can use and play with the newest version of Wear OS!
Wear OS system image

Wear OS system image

  • Heart Rate Sensor for Wear OS Emulators - To help you test your Wear OS apps, the Android Emulator now has support for the Heart Rate Sensor API when you run the Wear OS emulator. Make sure you are running at least Android Emulator v30.4.5 downloaded via the Android Studio SDK Manager
Heart Rate Sensor for Wear OS Emulators

Heart Rate Sensor for Wear OS Emulators

  • Google TV Remote Control - On top of running the new Google TV UI, we now have an updated Remote control panel, which has mapping for the new Google TV remote controls features like: user profile, and settings.
Google TV remote controls

Google TV remote controls

  • New Google TV system images - We have updated the system images to reflect the new Google TV experience allowing you to freely explore the UI.
Google TV system image

Google TV system image

  • Automotive OS Sensor Replay - You can now use the Android Automotive emulator to simulate driving scenarios, with the ability to replay car sensor data (e.g. speed, gear), completing your development and testing workflow.
Android Automotive OS Sensor replay

Android Automotive OS Sensor replay

Developer Productivity

  • IntelliJ Platform Update - Android Studio Arctic Fox (2020.3.1) Beta includes the IntelliJ 2020.3 platform release ?, which has many new features such as Debugger interactive hints, new Welcome screen, and a ton of new code editor enhancements to speed up your workflow. Learn more.
  • Android 12 lint checks - We’ve added lint checks that are specific to building your app for Android 12 so that you can get guidance in context. To name a few -- we have built checks for custom declarations of splash screens, coarse location permission for fine location usage, media formats, and high sensor sampling rate permission.
  • Non-transitive R classes Refactoring - Using non-transitive R classes with the Android Gradle Plugin can lead to faster builds for applications with multiple modules. It prevents resource duplication by ensuring that each module only contains references to its own resources, without pulling references from dependencies. You can access this feature by going to Refactor > Migrate to Non-transitive R Classes.
  • Apple Silicon Support Preview - For those using MacOS on Apple Silicon (arm64) hardware, Android Studio Arctic Fox provides preview support for this new architecture.  The arm64 platform support is still under active development, but we wanted to provide you a release order to get your feedback. Since this is a preview release for the arm64 architecture, you will have to separately download this version from the Android Studio download archive page and look for Mac (Apple Silicon).
  • Extended controls in the Emulator tool window - Developers now have access to all extended emulator controls when the emulator is opened in a tool window. The extended controls will give developers powerful tools for testing their apps such as navigation playback, virtual sensors, and snapshots all within Android studio. To launch the Emulator within Android Studio go to Android Studio's Preferences > Tools > Emulator and select “Launch in a tool window."
Extended controls in the Emulator tool window

Extended controls in the Emulator tool window

  • Background Task Inspector - You can now utilize the Background Task Inspector to visualize, monitor, and debug your app's background workers when using WorkManager library 2.5.0 or higher. You can access it by going to View > Tool Windows > App Inspection from the menu bar. When you deploy an app on a device running API level 26 and higher, you should see active workers in the Background Task Inspector tab, as shown below. Learn more.
Background Task Inspector

Background Task Inspector

  • Parallel device testing with Test Matrix - Instrumentation tests can now be run across multiple devices in parallel and investigated using a new specialized instrumentation test results panel, called the Test Matrix, which streams the test results in real time. Learn more
Test matrix running tests across multiple devices in parallel

Test matrix running tests across multiple devices in parallel

  • Memory Profiler new recording UI - We have consolidated the Memory Profiler UI for different recording activities, such as capturing a heap dump and recording Java, Kotlin, and native memory allocations.
Memory Profiler: recorded Java / Kotlin Allocations

Memory Profiler: recorded Java / Kotlin Allocations

  • Updated system requirements - In order to ensure that we provide the best experience for Android developers, we are updating the system requirements when using Android Studio. These requirements also represent the configurations we use to thoroughly test Android Studio to maintain high quality and performance, and we plan to update them more frequently going forward. So, while you’re still able to use systems that fall below the requirements, we can’t guarantee compatibility or support when doing so. You can see the updated system requirements on the official developer site.

To recap, Android Studio Arctic Fox (2020.3.1) Beta includes these new enhancements & features:

Design

  • Compose Preview
  • Compose Layout Inspector
  • Deploy Preview to Device
  • Live Edit of literals
  • Accessibility Scanner in Layout Editor

Devices

  • Wear OS Pairing
  • Heart Rate Sensor
  • New Wear OS system images
  • Google TV Remote Control
  • Google TV system Images
  • Automotive OS Sensor Replay

Productivity

  • Intellij 2020.3.1
  • Android 12 lint checks
  • Non-transitive R classes Refactoring
  • Apple Silicon Support Preview
  • Android Emulator Extended Controls
  • Background Task Inspector
  • Test matrix
  • Memory Profiler new recording UI

You might also have seen other new features at I/O which are not included in the list above; they are included in Android Studio (2021.1.1) Bumblebee Canary since these features were not quite ready for a beta channel release:

Design

  • Interactive Compose preview
  • Compose Animation preview
  • Preview Configuration Picker
  • Animated vector drawable preview
  • Compose Blueprint Mode
  • Compose Constraints Preview for ConstraintLayout

Devices

  • Automotive OS USB Passthrough - Coming soon
  • Automotive OS Rotary Controls - Coming soon

Productivity

  • Kotlin Coroutines debugger
  • Device Manager
  • Gradle Instrumented Test Runner Integration in Android Studio
  • Gradle Managed Devices

Sessions at Google I/O 2021

With this exciting release, 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 ?:


Getting Started

Android Studio Arctic Fox (2020.3.1) is a big release, and now is a good time to download and check out the Beta release to incorporate the new features into your workflow. The beta release is near stable release quality, but as with any beta release, bugs may still exist, so, if you do find an issue, let us know so we can work to fix it. If you’re already using Android Studio, you can check for updates on the Beta channel from the navigation menu (Help > Check for Update [Windows/Linux] , Android Studio > Check for Updates [OS X]). When you update to beta, you will get access to the new version of Android Studio and Android Emulator.

As always, we appreciate any feedback on things you like, and issues or features you would like to see. If you find a bug or issue, please file an issue. Follow us -- the Android Studio development team -- on Twitter and on Medium.

What’s new for Android developers at Google I/O

Posted by Karen Ng, Director, Product Management & Jacob Lehrbaum, Director of Developer Relations, Android & Play

As Android developers, we are all driven by building experiences that delight people around the world. And with people depending on your apps more than ever, expectations are higher and your jobs as developers aren’t getting easier. Today, at Google I/O, we covered a few ways that we’re trying to help out, whether it be through Android 12 - one of the biggest design changes ever, Jetpack, Jetpack Compose, Android Studio, and Kotlin to help you build beautiful high quality apps. We’re also helping when it comes to extending your apps wherever your users go, like through wearables and larger-screened devices. You can watch the full Developer Keynote, but here are a few highlights:

Android 12: one of the biggest design updates ever.

The first Beta of Android 12 just started rolling out, and it’s packed with lots of cool stuff. From new user safety features like permissions for bluetooth and approximate location, enhancements to performance like expedited jobs and start up animations, to delightful experiences with more interactive widgets and stretch overscrolling, this release is one of the biggest design updates to Android ever. You can read more about what’s in Android 12 Beta 1 here, so you can start preparing your apps for the consumer release coming out later this year. Download the Beta and try it with your apps today!

Android 12 visual

Jetpack Compose: get ready for 1.0 in July!

For the last few years, we’ve been hard at work modernizing the Android development experience, listening to your feedback to keep the openness–a hallmark of Android, but becoming more opinionated about the right way to do things. You can see this throughout, from Android Studio, a performant IDE that can keep up with you, to Kotlin, a programming language that enables you to do more with less code, to Jetpack libraries that solve the hardest problems on mobile with backward compatibility.

The next step in this offering is Jetpack Compose - our modern UI toolkit to easily build beautiful apps for all Android devices. We announced Compose here at Google I/O two years ago and since then have been building it in the open, listening to your feedback to make sure we got it right. With the Compose Beta earlier this year, developers around the world have created some truly beautiful, innovative experiences in half the time, and the response to the #AndroidDevChallenge blew our socks off!

With the forthcoming update of Material You (which you can read more about here), we’ll be adding new Material components as well as further support for building for large screens, making it fast and easy to build a gorgeous UI. We’re pressure testing the final bits in Compose and will release 1.0 Stable in July—so get ready!

Android Studio Arctic Fox: Design, Devices, & Developer Productivity!

Android Studio Arctic Fox (2020.3.1) Beta, the latest release of the official powerful Android IDE, is out today to help you build quality apps easier and faster. We have delivered and updated the suite of tools to empower three major themes: accelerate your UI design, extend your app to new devices, and boost your developer productivity. With this latest release you can create modern UIs with Compose tooling, see test results across multiple devices, and optimize debugging databases and background tasks with the App Inspector. We’re also making your apps more accessible with the Accessibility Scanner and more performant with Memory Profiler. And for faster build speeds, we have the Android Gradle plugin 7.0, new DSL, and variant APIs. You can learn more about the Android Studio updates here.

Android Studio Arctic Fox

Kotlin: the most used language by professional Android devs

Kotlin is now the most used primary language by professional Android developers according to our recent surveys; in fact, over 1.2M apps in the Play Store use Kotlin, including 80% of the top 1000 apps. And here at Google, we love it too: 70+ Google apps like Drive, Home, Maps and Play use Kotlin. And with a brand-new native solution to annotation processing for Kotlin built from the ground up, Kotlin Symbol Processing is available today, a powerful and yet simple API for parsing Kotlin code directly, showing speeds up to 2x faster with libraries like Room.

Android Jetpack: write features, not boilerplate

With Android Jetpack, we built a suite of libraries to help reduce boilerplate code so you can focus on the code you care about. Over 84% of the top 10,000 apps are now using a Jetpack library. And today, we’re unpacking some new releases for Jetpack, including Jetpack Macrobenchmark (Alpha) to capture large interactions that affect your app startup and jank before your app is released, as well as a new Kotlin Coroutines API for persisting data more efficiently via Jetpack DataStore (Beta). You can read about all the updates in Android Jetpack here.

Now is the time: a big step for Wear

The best thing about modern Android development is that these tools have been purpose built to help make it easy for you to build for the next era of Android, which is all about enabling devices connected to your phone–TVs, cars, watches, tablets–to work better together.

Starting today, we take a huge step forward with wearables. First, we introduced a unified platform built jointly with Samsung, combining the best of Wear and Tizen. Second, we shared a new consumer experience with revamped Google apps. And third, a world-class health and fitness service from Fitbit is coming to the platform. As an Android developer, it means you’ll have more reach, and you’ll be able to use all of your existing skills, tools, and APIs that make your mobile apps great, to build for a single wearables platform used by people all over the world.

Whether it’s new Jetpack APIs for Wear tailored for small screens and designed to optimize battery life, to the Jetpack Tiles API, so you can create a custom Tile for all the devices in the Wear ecosystem, there are a number of new features to help you build on Wear. And with a new set of APIs for Health and Fitness, created in collaboration with Samsung, data collection from sensors and metrics computation is streamlined, consistent, and accurate–like heart rate to calories to daily distance–from one trusted source. All this comes together in new tooling, with the release of Android Studio Arctic Fox Beta, like easier pairing to test apps, and even a virtual heart rate sensor in the emulator. And when your app is ready, users will have a much easier time discovering the world of Wear apps on Google Play, with some big updates to discoverability. You can read more about all of the Wear updates here.

Tapping the momentum of larger screens, like tablets, Chrome OS and foldables

When it comes to larger screens -- tablets, foldables, and Chrome OS laptops-- there is huge momentum. People are increasingly relying on large screen devices to stay connected with family and friends, go to school, or work remotely. In fact, there are over 250 million active large screen Android devices. Last year, Chrome OS grew +92% year over year–5 times the rate of the PC market, making Chrome OS the fastest growing and the second-most popular desktop OS. To help you take advantage of this momentum, we’re giving you APIs and tools to make optimizing that experience easier: like having your content resize automatically to more space by using SlidingpaneLayout 1.2.0 and a new vertical navigation rail component, Max widths on components to avoid stretched UIs, as well as updates to the platform, Chrome OS, and Jetpack windowmanager, so apps work better by default. You can learn more here.

Google Duo's optimized experience for foldable devices

Google Duo's optimized experience for foldable devices

This is just a taste of some of the new ways we’re making it easier for you to build high quality Android apps. Later today, we’ll be releasing more than 20 technical sessions on Android and Play, covering a wide range of topics such as background tasks, privacy, and Machine Learning on Android, or the top 12 tips to get you ready for Android 12. If building for cars, TVs, and wearables is your thing, we got that covered, too. You can find all these sessions - and more - on the I/O website. Beyond the sessions and news, there’s a number of fun ways to virtually connect with Googlers and other developers at this year’s Google I/O. You can check out the Android dome in I/O Adventure, where you can see new blog posts, videos, codelabs, and more. Maybe even test out your Jetpack Compose skills or take a virtual tour of the cars inside our dome!

Android Studio 4.2

Posted by Jamal Eason, Product Manager, Android

Android logo

We are excited to announce that Android Studio 4.2 is now available to download in the stable release channel. The focus areas for this release is an upgraded IntelliJ platform and a handful of new features centered around improving your productivity as an Android app developer.

We know sometimes upgrading your app project to the latest version can be complicated. To address this, we have a new app project upgrade assistant in Android Studio 4.2 that makes it easier to migrate your project and to take advantage of the latest Android Gradle Plugin APIs. Additionally, we have added a whole range of enhancements to the existing features like the Database Inspector, System Trace, SafeArgs support, Apply Changes, the new project wizard and more. If you use these features and you are looking for the next stable version of Android Studio, you should download Android Studio 4.2 today!

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

Develop

  • IntelliJ Platform Update - Android Studio 4.2 includes all the major features and updates found in IntelliJ IDEA Community Edition 2020.2, which includes an updated GitHub UI for pull requests, and new centralized problems window, and more. Learn more.
  • Safe Args Support - Using Safe Args is the recommended way to ensure data encapsulation if you want to pass data between two destinations in your app when you are using the Jetpack Navigation component. With Android Studio 4.2, you now have code autocompletion for Directions Args, and code navigation from source to XML. Learn more.
    safe arfs support

    Safe Args Support

  • New Project Wizard and Module Wizard Updates - This release includes a visual refresh to the new project wizard to make it easier to discover Android device types, plus we added ViewBinding to each of the templates as well. Furthermore, we also made a visual update to the new module wizards to make it easier to understand the variety of module types you can add to your app.
New Project Wizard  New Module Wizard

New Project Wizard & New Module Wizard

Debug

  • Database Inspector Improvements - Managing and monitoring your in app database is easier to do with the Database Inspector. In this release we made a couple new enhancements. We added a new offline mode, so that you can still keep inspecting your app's databases after a process disconnects, making it easier to diagnose your app after a crash. And we added a handy query history option as well.
Query History with the Database Inspector

Query History with the Database Inspector

  • Retrace Command Line Tool - As part of your app compilation process, R8 obfuscates Kotlin and Java programming language code. This can make stack traces impossible to decipher since types and method names are obfuscated and shortened to reduce the memory footprint of your app. The Retrace command line tool deobfuscates these names and recovers inlined frames using a mapping.txt file, making stack traces understandable again The new standalone tool can be found at ./sdk/cmdline-tools/latest/bin/retrace. Learn more.

Build

  • AGP Upgrade Assistant - Migrating your project to the latest Android Gradle Plugin (AGP) can sometimes be tricky especially if you use deprecated APIs. To solve this and to better prepare you for the transition to the Android Gradle Plugin 7.0, we created a new upgrade assistant. The assistant allows you to toggle the commands that will be executed on your project to upgrade to a higher version of AGP, preview exactly which files will be affected by the AGP upgrade, and lastly globally update deprecated configurations.
AGP Upgrade Assistant<

AGP Upgrade Assistant

  • Apply Changes Enhancements - Apply Changes lets you push code and resource changes to your running app without restarting your app. In Android Studio 4.2 we have expanded the number of compatible changes with Apply Changes to include adding resources (which accounted for 23% of changes that needed a full restart) and adding static final fields (e.g. constants) when running on an Android 11+ device or emulator.
  • Android Gradle Plugin 4.2 - With AGP 4.2, we made a number of notable changes. First, we implemented a new resources compiler which should aid in improving build performance especially on Windows machines. Secondly, we have updated the default Java programming language to version 8. Lastly, we added support for the APK v3 and APK v4 signing format. Learn more about additional AGP updates here.
// build.gradle.kts

android {
   ...
   signingConfigs {
      config {
          ...
          enableV3Signing(true)
          enableV4Signing(true)
      }
   }
}

APK v3 and APK v4 singing support

Test

  • Multiple Device Deployment - Sometimes when you are developing and testing your app it is helpful to deploy your app on multiple devices to see the results. We brought back this feature from very early versions of Android Studio and integrated it directly into the device selection menu in Android Studio 4.2. To note, if you deploy tests to multiple devices you may be prompted to enable this behavior.
Multiple Device Deployment

Multiple Device Deployment

Profile

  • System Trace Improvements - To understand the fine-grained performance characteristics of your app, it helps to use the system trace features inside of the Android Studio profiers. With this release of Android Studio, system trace now has a new events table. With this new table view you can see; BufferQueue, RSS memory counters, and CPU core frequency all within a compact user interface. Profiler with new System Trace Events Table

    Profiler with new System Trace Events Table

    To recap, Android Studio 4.2 includes these new enhancements & features:

    Develop

    • IntelliJ 2020.2.3 Platform Update
    • Safe Args Support
    • New Project Wizard and Module Wizard Updates

    Debug

    • Database Inspector Improvements
    • Retrace Command Line Tool

    Build

    • AGP Upgrade Assistant
    • Apply Changes Enhancements
    • Android Gradle Plugin 4.2

    Test

    • Multiple Device Deployment

    Profile

    • System Trace Improvements

    Check out the Android Studio release notes, Android Gradle plugin release notes, and the Android Emulator release notes for more details.


Getting Started

Download

Download the latest version of Android Studio 4.2 from the download page. If you are using a previous release of Android Studio, you can simply update to the latest version of Android Studio. 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 Arctic Fox at the same time. Learn more.

We appreciate any feedback on things you like, and issues or features you would like to see. If you find a bug or issue, feel free to file an issue. Follow us -- the Android Studio development team ‐ on Twitter and on Medium.

Java is a registered trademark of Oracle and/or its affiliates.

Students Learn Android App Development with Google Developer Student Clubs

Posted by Erica Hanson, Global Program Manager, Google Developer Student Clubs

Google Developer Student Clubs, a program of university based community groups for students interested in Google developer technologies, recently started hosting study groups called Android Study Jams. The goal? Learn Android app development through hands-on codelabs in an online curriculum provided by Google. There are two tracks: one for students who are new to programming, and one for those who already have experience. Interested in participating? Facilitator materials are available for anyone to host Android Study Jams in their community - take a look and get to building.

Google Developer Student Clubs are dedicated to helping students learn programming together, among peers, in a fun and interactive setting. While over 50 thousand students from all over the world have participated in these Android workshops, we wanted to highlight the exciting work from groups in Indonesia, Turkey, and Nigeria. From programming in Kotlin to building a series of apps, these students have put their minds to work.

Learn more about what these three clubs have been up to below.

Indonesia

(Image from UNPNVJ’s Android Study Jams where students are learning Kotlin)

Club members from Universitas Pembangunan Nasional Veteran Jakarta in Indonesia recently came together to host a virtual Android Study Jams session with over 60 students to learn the basics of building Android apps. Their student-run learning session covered several topics, including:

  • An introduction to developing for Android
  • An introduction to coding in the Kotlin programming language
  • A tutorial on setting up and working in Android Studio

After the students felt comfortable with the basics of Kotlin and Android Studio, they combined their new skills to create their own layouts for a birthday card app.

(Image of Birthday cake app)

We can’t wait to see what the students from UPNVJ build next on Android thanks to their new programming skills.

Turkey

(Image from Medipol University where Nelson Glauber is teaching students the basics of Android App Development)

Medipol University in Turkey also hosted their own Android Study Jams by organizing a livestream with over 500 participants. Nelson Glauber, who was the first Google Developer Expert for Android in Latin America, led the event and helped students learn more about topics like:

  • How to display text and images in an app
  • Adding a button to an app and making it interactive
  • Learning more programming concepts in Kotlin like classes, objects, and conditionals

After taking students’ questions, Nelson worked with them to build an interactive dice roller app that updates the screen after the results of a roll.

(Image of Dice Roller app)

Nigeria

The Google Developer Student Club at Kaduna State University in Nigeria tackled different codelabs and learning pathways in their Android Study Jams. In particular, the group worked on the following topics:

  • Adding an additional screen to an app
  • Learning how the Jetpack Navigation Component makes it easier to manage navigation in an app
  • Learning the best practices of app architecture

With these new skills, the group is now able to start working on building more advanced apps that allow users to navigate between multiple screens.

(Gif of Cupcake app)

How to join a Google Developer Student Club and Android Study Jams

If you’re a university student looking to learn more about programming alongside a community of your peers, sign up for a Google Developer Student Club near you here. As a part of the community, you’ll have access to special learning opportunities, including Android Study Jams, on many of Google’s developer products.

If you want to lead your own Android Study Jams or explore other free resources for learning Android development, click here.

Students Learn Android App Development with Google Developer Student Clubs

Posted by Erica Hanson, Global Program Manager, Google Developer Student Clubs

Google Developer Student Clubs, a program of university based community groups for students interested in Google developer technologies, recently started hosting study groups called Android Study Jams. The goal? Learn Android app development through hands-on codelabs in an online curriculum provided by Google. There are two tracks: one for students who are new to programming, and one for those who already have experience. Interested in participating? Facilitator materials are available for anyone to host Android Study Jams in their community - take a look and get to building.

Google Developer Student Clubs are dedicated to helping students learn programming together, among peers, in a fun and interactive setting. While over 50 thousand students from all over the world have participated in these Android workshops, we wanted to highlight the exciting work from groups in Indonesia, Turkey, and Nigeria. From programming in Kotlin to building a series of apps, these students have put their minds to work.

Learn more about what these three clubs have been up to below.

Indonesia

(Image from UNPNVJ’s Android Study Jams where students are learning Kotlin)

Club members from Universitas Pembangunan Nasional Veteran Jakarta in Indonesia recently came together to host a virtual Android Study Jams session with over 60 students to learn the basics of building Android apps. Their student-run learning session covered several topics, including:

  • An introduction to developing for Android
  • An introduction to coding in the Kotlin programming language
  • A tutorial on setting up and working in Android Studio

After the students felt comfortable with the basics of Kotlin and Android Studio, they combined their new skills to create their own layouts for a birthday card app.

(Image of Birthday cake app)

We can’t wait to see what the students from UPNVJ build next on Android thanks to their new programming skills.

Turkey

(Image from Medipol University where Nelson Glauber is teaching students the basics of Android App Development)

Medipol University in Turkey also hosted their own Android Study Jams by organizing a livestream with over 500 participants. Nelson Glauber, who was the first Google Developer Expert for Android in Latin America, led the event and helped students learn more about topics like:

  • How to display text and images in an app
  • Adding a button to an app and making it interactive
  • Learning more programming concepts in Kotlin like classes, objects, and conditionals

After taking students’ questions, Nelson worked with them to build an interactive dice roller app that updates the screen after the results of a roll.

(Image of Dice Roller app)

Nigeria

The Google Developer Student Club at Kaduna State University in Nigeria tackled different codelabs and learning pathways in their Android Study Jams. In particular, the group worked on the following topics:

  • Adding an additional screen to an app
  • Learning how the Jetpack Navigation Component makes it easier to manage navigation in an app
  • Learning the best practices of app architecture

With these new skills, the group is now able to start working on building more advanced apps that allow users to navigate between multiple screens.

(Gif of Cupcake app)

How to join a Google Developer Student Club and Android Study Jams

If you’re a university student looking to learn more about programming alongside a community of your peers, sign up for a Google Developer Student Club near you here. As a part of the community, you’ll have access to special learning opportunities, including Android Study Jams, on many of Google’s developer products.

If you want to lead your own Android Study Jams or explore other free resources for learning Android development, click here.

Announcing Jetpack Compose Beta!

Posted by Anna-Chiara Bellini, Product Manager, Nick Butcher, Developer Relations

The Android Show: Jetpack Compose, Feb. 24 at 9am PT

Today, we’re launching the beta release of Jetpack Compose, our new UI toolkit designed to make it faster and easier to build native apps across all Android platforms. Compose offers modern, declarative Kotlin APIs, helping you build beautiful, responsive apps with way less code. Built to integrate with existing Android apps and Jetpack libraries, you can adopt Compose at your own pace by combining Android Views and Compose.

With this beta release, Compose is API complete and has all the features you need to build production-ready apps. Beta also means API stable, so we won’t change or remove APIs. Now is a great time to start learning Compose and begin planning for how you will use it in an upcoming project or feature once it reaches 1.0 later this year.

What's In Beta

Our team has been developing Compose in the open with feedback and participation from the community. Since open sourcing development in 2019, we’ve had 30 public releases, addressed over 700 external bugs, and accepted over 200 external contributions. We love seeing what you’ve been building with Compose and have used your feedback and feature requests to refine our APIs and prioritize our work. Since the alpha release, we’ve added and improved a number of new features:

  • ? Coroutines support
  • ? Accessibility support for Talkback - support for other technologies will be in Stable
  • ? Easy to use Animations, with a completely new API since alpha.
  • Interoperability with Views
  • Material UI Components, all with @Sampled code
  • Lazy Lists - Jetpack Compose's take on RecyclerView
  • DSL-based Constraint Layout
  • Modifiers
  • Testing
  • Theming and Graphics, with easy support for Dark and Light mode
  • Input and gestures
  • Text and editable text
  • Window management

For the beta release, we’ve been focused on ensuring API completeness; that all foundational APIs are in place for us to continue to build upon for 1.0 and beyond. We’ll work on stabilizing these APIs up to our 1.0 release with particular focus on app performance and accessibility.

Compose Beta is supported by the latest Canary of Android Studio Arctic Fox, which features many new tools:

    ? Live Literals: real time update of literals in Preview and on device or emulator

    ? Animation Preview: inspect and playback animations

    ? Compose support in the Layout Inspector

    ? Interactive preview: inspect and interact with a Composable in isolation

    ? Deploy Preview: to deploy a Composable on your device without needing a full app

Live Literals on Android Emulator


Layout Inspector for Jetpack Compose

Works with your existing app

Jetpack Compose is designed to work seamlessly with Android Views, letting you adopt at your own pace. You can embed Compose UIs within Android Views and use Views within Compose. We lay out a number of adoption strategies in our interoperability documentation.

In addition to View interop, we integrate with common libraries to help you to add Compose to your existing applications—no need to rewrite or re-architect your app. We offer integrations with:

  • Navigation
  • ViewModel
  • LiveData / Rx / Flow
  • Paging
  • Hilt

The MDC-Android Compose Theme Adapter and Accompanist libraries provide integrations with Material and AppCompat XML themes so you don’t need to duplicate theme definitions. Accompanist also offers wrappers for common image loading libraries.

Thinking in Compose

Jetpack Compose is a declarative UI toolkit, a paradigm shift from the current View system, where you describe what your UI should look like for a given application state, not how to produce it. Compose takes care of updating your UI when your app state changes, so you don’t have to manipulate your UI into the desired state which can be tedious and error prone.

Built entirely in Kotlin, Compose takes advantage of its great language features to offer powerful, succinct, intuitive APIs. Coroutines for example enable us to write much simpler async APIs such as describing gestures, animation or scrolling. This makes it easier to write code that combines async events, like a gesture which hands off to an animation, all with cancellation and clean-up provided by structured concurrency.

Learning Compose

To help you and your team learn all about Jetpack Compose, we’ve updated our learning pathway; a curated list of videos, hands-on codelabs and key docs to get you started. Today we’re releasing new & updated documentation guides, a number of screencasts and a new Animation Codelab to help dive deeper into how to build with Compose. From guidance on architecture, accessibility and testing, to deep dives into animation, lists or thinking in Compose, we have guides to help you get up to speed.

We also offer 8 official sample applications if you want to jump straight in and see Compose in action. We have simple to complex samples, each showcasing different APIs and use cases. Check the readme for more details.


#AndroidDevChallenge: learn Compose and win prizes

If you’re ready to get started with Compose–and also want to win some prizes along the way, check out the #AndroidDevChallenge. For the next four weeks, we’ll have weekly challenges designed to give your very own insights into Jetpack Compose, so you can fly through your projects. Compete to win new prizes for each challenge, with over one thousand prizes to win including a Google Pixel 5. You can read more about the first weekly challenge - starting today - right here.

With Jetpack Compose reaching Beta—with stable APIs and feature complete for 1.0—it's a great time to start learning Jetpack Compose and planning how you might use it in an upcoming project. We’d love to hear your feedback on adopting Compose in your app or join the discussion in the Kotlin Slack #compose channel.

Announcing Android Studio Arctic Fox (2020.3.1) & Android Gradle plugin 7.0

Posted by Jamal Eason, Product Manager

Android Studio logo

Today marks the release of the first version of Android Studio Arctic Fox (2020.3.1) on the canary channel, together with Android Gradle plugin (AGP) version 7.0.0-alpha01. With this release, we are adjusting the version numbering of Android Studio and our Gradle plugin. This change decouples the Gradle plugin from the Android Studio versioning scheme and brings more clarity to which year and IntelliJ version Android Studio aligns with for each release.

New versioning scheme - Android Studio

With Android Studio Arctic Fox (2020.3.1) we are moving to a year-based system that is more closely aligned with IntelliJ IDEA, the IDE upon which Android Studio is built. We are changing the version numbering scheme to encode a number of important attributes: the year, the version of IntelliJ it is based on, plus feature and patch level. WIth this name change you can quickly figure out which version of the IntelliJ platform you are using in Android Studio. In addition, each major version will have a canonical codename, starting with Arctic Fox, and then proceeding alphabetically to help make it easy to see which version is newer.

We recommend that you use the latest version of Android Studio so that you have access to the latest features and quality improvements. To make it easier to stay up to date, we made the version change to clearly de-couple Android Studio from your Android Gradle Plugin version. An important detail to keep in mind is that there is no impact to the way the build system compiles and packages your app when you update the IDE. In contrast, app build process changes and APK/Bundles are dictated by your project AGP version. Therefore, it is safe to update your Android Studio version, even late in your development cycle, because your project AGP version can be updated in a different cadence than your Android Studio version. Lastly, with the new version system it is even easier than before for you or your team to run both the stable and preview versions of Android Studio at the same time on your app project as long as you keep the AGP version on a stable release.

In the previous numbering system, this release would have been Android Studio 4.3. With the new numbering system, it is now Android Studio Arctic Fox (2020.3.1) Canary 1 or just, Arctic Fox.

Going forward, here is how the Android Studio version number scheme will work:

<Year of IntelliJ Version>.<IntelliJ major version>.<Studio major version>

  • The first two number groups represent the version of the final IntellIj platform that a particular Android Studio release is based on (earlier canaries may still be on the earlier version). For this release, this is 2020.3.
  • The third number group represents the Studio major version, starting at 1 and incrementing by one for every major release.
  • To make it easier to refer to each version, we are also giving major releases a code name, incrementing from A to Z based on animal names. This initial release name is Arctic Fox.

New versioning scheme - Android Gradle plugin

With AGP 7.0.0 we are adopting the principles of semantic versioning, and aligning with the Gradle version that AGP requires. Compatibility between Android Studio and Android Gradle plugin remains unchanged. Projects that use stable versions of AGP can be opened with newer versions of Android Studio.

We will publish another post soon with more details about our AGP versioning philosophy and what is new in AGP 7.0.

What is new in Android Studio Arctic Fox

We are in early days in the feature development phase for Arctic Fox, but we have invested much of our time in addressing over 200 quality improvements and bugs across a wide range of areas in the IDE from the code editor, app inspection tools, layout editor to the embedded emulator. Check out the release notes for the specific bug fixes.

For those trying out Jetpack Compose, we have a host of new updates, like deploy @Preview composables to device/emulator:

Deploy preview composable

Also try out the new Layout Validation Tool in Arctic Fox to see how your layout responds to various screens sizes, font sizes, and Android Color Correction/Color Blind Modes. You can access this via the Layout Validation tool window when you are using the Layout Editor.

Layout Validation

Lastly, for those running MacOS (other platforms are coming soon) with the latest Android Platform tools and an Android 11 device, you can try out the IDE integration for the Wireless ADB feature by going to the Run device selection dialogue → Pair Devices Using Wi-Fi.

Menu to access Wireless ADB feature

Wireless ADB Setup Window

What’s Next

If you want to learn more about other detailed changes coming with this release for both Android Studio and the Android Gradle plugin, make sure to take a look at the release notes.

Announcing Android Studio Arctic Fox (2020.3.1) & Android Gradle plugin 7.0

Posted by Jamal Eason, Product Manager

Android Studio logo

Today marks the release of the first version of Android Studio Arctic Fox (2020.3.1) on the canary channel, together with Android Gradle plugin (AGP) version 7.0.0-alpha01. With this release, we are adjusting the version numbering of Android Studio and our Gradle plugin. This change decouples the Gradle plugin from the Android Studio versioning scheme and brings more clarity to which year and IntelliJ version Android Studio aligns with for each release.

New versioning scheme - Android Studio

With Android Studio Arctic Fox (2020.3.1) we are moving to a year-based system that is more closely aligned with IntelliJ IDEA, the IDE upon which Android Studio is built. We are changing the version numbering scheme to encode a number of important attributes: the year, the version of IntelliJ it is based on, plus feature and patch level. WIth this name change you can quickly figure out which version of the IntelliJ platform you are using in Android Studio. In addition, each major version will have a canonical codename, starting with Arctic Fox, and then proceeding alphabetically to help make it easy to see which version is newer.

We recommend that you use the latest version of Android Studio so that you have access to the latest features and quality improvements. To make it easier to stay up to date, we made the version change to clearly de-couple Android Studio from your Android Gradle Plugin version. An important detail to keep in mind is that there is no impact to the way the build system compiles and packages your app when you update the IDE. In contrast, app build process changes and APK/Bundles are dictated by your project AGP version. Therefore, it is safe to update your Android Studio version, even late in your development cycle, because your project AGP version can be updated in a different cadence than your Android Studio version. Lastly, with the new version system it is even easier than before for you or your team to run both the stable and preview versions of Android Studio at the same time on your app project as long as you keep the AGP version on a stable release.

In the previous numbering system, this release would have been Android Studio 4.3. With the new numbering system, it is now Android Studio Arctic Fox (2020.3.1) Canary 1 or just, Arctic Fox.

Going forward, here is how the Android Studio version number scheme will work:

<Year of IntelliJ Version>.<IntelliJ major version>.<Studio major version>

  • The first two number groups represent the version of the final IntellIj platform that a particular Android Studio release is based on (earlier canaries may still be on the earlier version). For this release, this is 2020.3.
  • The third number group represents the Studio major version, starting at 1 and incrementing by one for every major release.
  • To make it easier to refer to each version, we are also giving major releases a code name, incrementing from A to Z based on animal names. This initial release name is Arctic Fox.

New versioning scheme - Android Gradle plugin

With AGP 7.0.0 we are adopting the principles of semantic versioning, and aligning with the Gradle version that AGP requires. Compatibility between Android Studio and Android Gradle plugin remains unchanged. Projects that use stable versions of AGP can be opened with newer versions of Android Studio.

We will publish another post soon with more details about our AGP versioning philosophy and what is new in AGP 7.0.

What is new in Android Studio Arctic Fox

We are in early days in the feature development phase for Arctic Fox, but we have invested much of our time in addressing over 200 quality improvements and bugs across a wide range of areas in the IDE from the code editor, app inspection tools, layout editor to the embedded emulator. Check out the release notes for the specific bug fixes.

For those trying out Jetpack Compose, we have a host of new updates, like deploy @Preview composables to device/emulator:

Deploy preview composable

Also try out the new Layout Validation Tool in Arctic Fox to see how your layout responds to various screens sizes, font sizes, and Android Color Correction/Color Blind Modes. You can access this via the Layout Validation tool window when you are using the Layout Editor.

Layout Validation

Lastly, for those running MacOS (other platforms are coming soon) with the latest Android Platform tools and an Android 11 device, you can try out the IDE integration for the Wireless ADB feature by going to the Run device selection dialogue → Pair Devices Using Wi-Fi.

Menu to access Wireless ADB feature

Wireless ADB Setup Window

What’s Next

If you want to learn more about other detailed changes coming with this release for both Android Studio and the Android Gradle plugin, make sure to take a look at the release notes.

Android Studio 4.1

Posted by Scott Swarthout, Product Manager

Android Studio logo

Today, we’re excited to release the stable version of Android Studio 4.1, with a set of features addressing common editing, debugging, and optimization use cases. A major theme for this release was helping you be more productive while using Android Jetpack libraries, Android’s suite of libraries to help developers follow best practices and write code faster. Based on your feedback we made a number of improvements to the code editing experience with IDE integrations for popular Android libraries.

Some highlights of Android Studio 4.1 include a new Database Inspector for querying your app’s database, support for navigating projects that use Dagger or Hilt for dependency injection, and better support for on-device machine learning with support for TensorFlow Lite models in Android projects. We’ve also made updates to Apply Changes to make deployment faster. Based on your feedback, we’ve made several changes to help game developers with a new native memory profiler and standalone profiling tools.

Product quality continues to be a major focus for the team, and we’ve been hard at work tracking down bugs and performance issues. We’ve heard from many developers that they liked the focus on better performance and reliability, so we’re happy to report that during this release cycle we’ve fixed 2,370 bugs and closed 275 public issues. We stay committed to maintaining high quality since we know that is key to your developer productivity.

Thank you to those who gave your early feedback in preview releases. Your feedback helped us iterate and improve features in Android Studio 4.1. If you are ready for the next stable release, and want to use a new set of productivity features, Android Studio 4.1 is ready to download for you to get started.

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

Design

Material Design Components updates

Android Studio templates in the create New Project dialog now use Material Design Components (MDC) and conform to updated guidance for themes and styles by default. These changes will make it easier to use recommended material styling patterns and support modern UI features like dark themes.

Material Design Components updates

Material Design Components updates in Project Templates

Updates include:

  • MDC: Projects depend on com.google.android.material:material in build.gradle. Base app themes use Theme.MaterialComponents.* parents and override updated MDC color and “on” attributes.
  • Color resources: Color resources in colors.xml use literal names (for example, purple_500 instead of colorPrimary).
  • Theme resources: Theme resources are in themes.xml (instead of styles.xml) and use Theme.<ApplicationName> names.
  • Dark theme: Base application themes use DayNight parents and are split between res/values and res/values-night.
  • Theme attributes: Color resources are referenced as theme attributes (for example, ?attr/colorPrimary) in layouts and styles to avoid hard-coded colors.

Develop

Database Inspector

We wanted to make it easier to inspect, query, and modify your app's databases using the new Database Inspector. To get started, deploy your app to a device running API level 26 or higher and select View > Tool Windows > Database Inspector from the menu bar. Whether your app uses the Jetpack Room library or the Android platform version of SQLite directly, you can now easily inspect databases and tables in your running app or run custom queries.

Because Android Studio maintains a live connection while you’re inspecting your app, you can also modify values using the Database Inspector and see those changes in your running app. If you use the Room persistence library, Android Studio also places run buttons next to each query in the code editor to help you quickly run queries you define in your @Query annotations. Learn more

Database inspector

Inspect, query, and modify your app’s databases with the Database Inspector

Run Android Emulator directly in Android Studio

You can now run the Android Emulator directly in Android Studio. Use this feature to conserve screen real estate, to navigate quickly between the emulator and the editor window using hotkeys, and to organize your IDE and emulator workflow in a single application window. You can manage snapshots and common emulator actions like rotating and taking screenshots from within Studio, but access to the full set of options still requires running the stable emulator. You can opt-in to use this feature by going to File → SettingsToolsEmulator Launch in Tool Window.

Android Emulator in Android Studio

Run the Android Emulator inside of Android Studio

Dagger Navigation Support

Dagger is a popular library for dependency injection on Android. Android Studio makes it easier to navigate between your Dagger-related code by providing new gutter actions and extending support in the Find Usages window. For example, clicking on the go to producer gutter action gutter action next to a method that consumes a given type navigates you to the provider of that type. Conversely, clicking on the go to consumer gutter action gutter action navigates you to where a type is used as a dependency. Android Studio also supports navigation actions for dependencies defined with the Jetpack Hilt library. Learn more.

Gutter actions navigation in Android Studio

Navigate between Dagger-related code with gutter actions

Use TensorFlow Lite models

Android developers are using machine learning to create innovative and helpful experiences. TensorFlow Lite is a popular library for writing mobile machine learning models, and we wanted to make it easier to import these models into Android apps. Similar to view binding, Android Studio generates easy-to-use classes so you can run your model with less code and better type safety. The current implementation of ML Model Binding supports image classification and style transfer models, provided they are enhanced with metadata.

To see the details for an imported model and get instructions on how to use it in your app, double-click the .tflite model file in your project to open the model viewer page. Learn more.

TensorFlow Lite in Android Studio 4.1

View TensorFlow Lite model metadata in Android Studio 4.1

Build & Test

Android Emulator - Foldable Hinge Support

Android Studio

In addition to recently adding 5G cellular testing support, we’ve added support for foldables in the Android emulator. With Android emulator 30.0.26 and above, you can configure foldable devices with a variety of fold designs and configurations. When a foldable device is configured, the emulator will publish hinge angle sensor updates and posture changes, so you can test how your app responds to these form factors. See the Developing for Android 11 with the Android Emulator blogpost to read more.

Extended controls, device pose

Apply Changes updates

Faster builds help developers make changes to their app more easily and quickly. To help you be more productive as you iterate on your app, we've made multiple enhancements to Apply Changes for devices running Android 11 or higher.

We've invested heavily in optimizing your iteration speed by developing a method to deploy and persist changes on a device without installing the application. After an initial deploy, subsequent deploys to Android 11 devices using either Apply Code Changes or Apply Changes and Restart Activity are now significantly faster. We’ve also added support for additional code changes in Apply Changes. Now if you add a method, you can deploy those changes to a running app by clicking either Apply Code Changes or Apply Changes and Restart Activity.

Export C/C++ dependencies from AARs

Android Gradle Plugin 4.0 added the ability to import Prefab packages in AAR dependencies. We wanted to extend the capability of this feature to support sharing native libraries as well. AGP version 4.1 enables exporting libraries from your external native build in an AAR for an Android Library project. To export your native libraries, add the following to the android block of your library project's build.gradle file:

buildFeatures {
    prefabPublishing true
}

prefab {
    mylibrary {
      headers "src/main/cpp/mylibrary/include"
    }

    myotherlibrary {
        headers "src/main/cpp/myotherlibrary/include"
    }
}

Symbolication for native crash reports

When a crash or ANR occurs in native code, the system produces a stack trace, which is a snapshot of the sequence of nested functions called in your program up to the moment it crashed. These snapshots can help you to identify and fix any problems in the source, but they must first be symbolicated to translate the machine addresses back into human-readable function names.

If your app or game is developed using native code, like C++, you can now upload debug symbols files to the Play Console for each version of your app. The Play Console uses these debug symbols files to symbolicate your app's stack traces, making it easier to analyze crashes and ANRs. To include debug symbols in your app bundle, add the following line to your project’s build.gradle file:

android.buildTypes.release.ndk.debugSymbolLevel = 'SYMBOL_TABLE'

Optimize

System Trace UI improvements

In Android Studio 4.1 we’ve overhauled System Trace, an optimization tool that gives you a real-time look at how your app is using system resources. We made it easier to select a trace with box selection mode, added a new analysis tab, and added more frame rendering data to help you investigate rendering issues in your app’s UI. Learn more.

Box selection: In the Threads section, you can now drag your mouse to perform a box selection of a rectangular area, which you can zoom into by clicking the Zoom to Selection button on the top right (or use the M keyboard shortcut). When you drag and drop similar threads next to each other, you can select across multiple threads to inspect all of them at once.

Use box selection to more easily select traces.

Trace selection

Summary tab: The new Summary tab in the Analysis panel displays:

  • Aggregate statistics for all occurrences of a specific event, such as an occurrence count and min/max duration.
  • Trace event statistics for the selected occurrence.
  • Data about thread state distribution.
  • Longest-running occurrences of the selected trace event.
View aggregated statistics in Summary tab of Android Studio 4.1

View aggregated statistics in the Summary tab

Display data: In the Display section, new timelines for SurfaceFlinger and VSYNC help you investigate rendering issues in your app's UI.

Standalone profilers

It's now possible to access the Android Studio Profilers in a separate window from the primary Android Studio window. This is useful when optimizing Android games built with other tools like Unity or Visual Studio.

To run the standalone profilers, do the following:

  1. Make sure the profilers in Android Studio are not already running on your system.
  2. Go to the installation directory and navigate to the bin directory:

Windows/Linux: <studio-installation-folder>\bin

macOS: <studio-installation-folder>/Contents/bin

  1. Depending on your OS, run profiler.exe or profiler.sh

The standalone profiler will allow you to connect to the Android emulator or any connected devices.

Standalone Android Studio profiler

Optimize your app with the Standalone Android Studio Profilers

Native Memory Profiler

Tracking native memory usage is important for game developers and other developers using C++ to understand how to optimize their app’s memory consumption. The Android Studio Memory Profiler now includes a Native Memory Profiler for apps deployed to physical devices running Android 10 or later. The Native Memory Profiler tracks allocations/deallocations of objects in native code for a specific time period and provides information about total allocations and remaining system heap size.

To initiate a recording, click Record native allocations at the top of the Memory Profiler window:

Native Memory Profiler window in Android Studio 4.1

View native memory allocations with the Native Memory Profiler

To recap, Android Studio 4.1 includes these new enhancements & features:

Design

  • Material Design Components updates

Develop

  • Database Inspector
  • Run Android Emulator directly in Android Studio
  • Dagger navigation support
  • Use TensorFlow Lite models

Build & Test

  • Android Emulator - Foldable Hinge Support
  • Apply Changes updates
  • Export C/C++ dependencies from AARs
  • Symbolification for native crash reports

Optimize

  • System Trace UI Improvements
  • Standalone profilers
  • Native Memory Profiler

These materials are not sponsored by or affiliated with Unity Technologies or its affiliates. “Unity” is a trademark or registered trademark of Unity Technologies or its affiliates in the U.S. and elsewhere.

Announcing Jetpack Compose Alpha!

Posted by Karen Ng, Director, Product Management

Today, we’re releasing the alpha of Jetpack Compose, our modern UI toolkit designed to help you quickly and easily build beautiful apps across all Android platforms, with native access to the platform APIs. Bring your app to life with dramatically less code, interactive tools, and intuitive Kotlin APIs.

No matter where you’re working from -- whether it’s your kitchen table or an office, we know you need a programming language, an IDE and a powerful UI framework that can save you time and reduce how much code you need to write. So we built Jetpack Compose to make you (and us!) more productive with building UI.

We started with Android Jetpack — taking the hardest, most common developer problems on Android and creating a suite of libraries that ensure high quality apps that work across all versions of the platform. Today, 84% of the top 10,000 apps in the Play store are using a Jetpack library.

Then we heard how developers love Kotlin, with over 70% of the top 1000 apps and 60% of pro Android developers using Kotlin today. The Google Home app saw, in certain instances, an 80% reduction in lines of code by using Kotlin and a decrease of NullPointerExceptions by 33% compared to a similar past period. Duolingo, saw reduced line count by an average of 30%.

Finally, we heard strong feedback from the community that developers like the simplicity of declarative APIs for building UI. Jetpack Compose combines all three of these: APIs for high quality apps at scale, an intuitive language, and a reactive programming model.

Jetpack

Jetpack Compose: Now in Alpha

Jetpack Compose Alpha has what you need to build full-fledged Android apps, including powerful tools and interoperability with existing Android views so you don’t need to rewrite your app. Compose APIs are designed and developed hand-in-hand with a set of canonical sample apps that use Material Design that we’re excited to release today! You can import and explore the latest samples directly in Android Studio as well.

compose

The alpha release includes:

  • Animations
  • Constraint Layout
  • Initial A11Y support
  • Input and Gestures
  • Interoperability with Views (start mixing Composable functions in your existing app)
  • Lazy Lists
  • Material UI components
  • Performance optimizations
  • Testing
  • Text and editable Text
  • Theming and Graphics
  • Window management

We've also added a number of new capabilities to Android Studio 4.2 canary, in close partnership with the JetBrains Kotlin team, to help you build apps with Compose:

  • Compose Code completion
  • Compose Preview Annotations
  • Deploy individual composables to any device
  • Interactive Compose previews
  • Kotlin compiler plugin for code generation
  • Sample Data API for Compose

Thinking in Compose

Compose uses a programming model that is quite different from the existing model of building UI on Android. Historically, an Android view hierarchy has been represented as a tree of UI widgets. As the state of the app changes, the UI hierarchy needs to be updated to display the current data. The most common way of updating the UI is to walk the tree using functions like findViewById(), and change nodes by calling methods like:

 button.setText(String) 
container.addView(View) 
 img.setImageBitmap(Bitmap) 
These methods change the internal state of the widget. Not only can this be tedious, but updating views manually increases the likelihood of errors (e.g. forgetting to update a view).

Jetpack Compose is a fully declarative component-based approach, meaning you describe your UI as functions that transform data into a UI hierarchy. When the underlying data changes, the Compose framework automatically updates the UI hierarchy for you, making it simple to build UIs easily and quickly.

Full interop with existing Android views

Adopting any new framework is a big change for existing projects and codebases, which is why we’ve designed Compose to be as easy to adopt as Kotlin — it is fully interoperable with existing Android code, from day one.

Migrating to Compose depends on you and your team. If you're building a new app, the best option might be to implement your entire UI with Compose. We know that most of you have large existing codebases, so rather than rewriting your app, you can combine Compose with your existing UI design.

There are two main ways you can combine Compose with a view-based UI:

  • You can add Compose elements into your existing UI, either by creating an entirely new Compose-based screen, or by adding Compose elements into an existing fragment or view layout.
  • You can add a view-based UI element into your composable functions. Doing so lets you add non-Compose widgets, such as MapView or WebView, into a Compose-based design.

We’ve also published a new library, MDC Compose Theme Adapter, which allows you to reuse your existing Material Components themes within your Compose UI.

To learn more, try the Compose for existing apps codelab or check out these two samples:

  • Tivi and Sunflower are existing apps which are being integrated with Compose
  • Crane sample app, embeds a MapView in Compose

Powerful Tools

Jetpack Compose is built with powerful tooling in Android Studio, designed to help you iterate quickly on the piece of UI you’re working on.

The Compose layout preview enables you to preview your Compose components without having to deploy your app to a device or emulator. As you develop your app, your previews update to help you review your changes faster. To create a layout preview, write a composable function that does not take any parameters, and add the

 @Preview annotation 
After you build your app, the preview function's UI appears in Studio's Preview pane.

Jetpack

Android Studio provides an interactive preview mode. While you're in interactive preview mode, you can click or type in your UI elements, and the UI responds as if it were in the installed app.

Jetpack

You can also deploy a single composable to your physical device or Android Emulator. Android Studio creates a new activity containing the UI generated by that function, and deploys it to your app on the device. This lets you try out the UI on an actual device without needing to reinstall the entire app or navigate to its location.

Jetpack

Get started with Jetpack Compose

To get started with Jetpack Compose, try the Compose Tutorial and get setup. Or dive right into the sample apps and walk through those apps in ‘Compose by Example’:

To find a comprehensive set of Compose resources, from new codelabs and expanded documentation, see the Compose pathway.

Since we open-sourced Jetpack Compose last year, so many of you have given us invaluable feedback, logged bugs, or contributed CLs and have gotten us where we are today. Thank you!

Compose isn’t recommended for full production use yet, in particular as we work towards API stability and finish performance optimizations, but we’d love you to give it a try and share feedback. Join us in the discussion on the #compose channel at Kotlin Slack. Compose 1.0 is expected in 2021.

Happy Composing!