SPEAKER: Android Studio Electric Eel
version 2022.1.1 is now available for download
on the Stable Channel.
This release contains many new features and improvements,
including the new Logcat UI enabled by default,
the ability to see data from Firebase Crashlytics right
within the ID with App Quality Insights,
improvements to Jetpack Compose previews,
new options for emulators and devices, and more.
Let's take a look at what's new in detail.
First, Logcat has been updated to make it easier to parse,
query, and track logs.
The new Logcat UI has been available to try
as an opt-in feature in Dolphin, and it's now enabled by default
in Electric Eel, including a number
of quality of life and stability fixes since Dolphin.
We've already covered its new features in the Dolphin release
video and release notes.
So you can check those out to learn more.
They are linked in the description.
To highlight just a couple things,
the new UI includes better formatting for logs
and a smarter search filled with auto completion support
to filter for the logs you want to see.
For example, you can filter for the package
name of your app or search by tags or messages
of log entries.
You can also configure the formatting
for the logs to see just the information you
want to focus on.
There's a standard and a complex view available,
and you can customize these as well.
For example, I can show tags in the compact view
and then choose to use this view by default.
Next up, let's take a look at the New App Quality Insights
tools, which lets you browse and investigate
crash data from Firebase Crashlytics
directly in Android Studio without having
to jump back and forth between the ID and the browser.
To get started, sign in to your Google account in Android
Studio to connect to Firebase and then open the App Quality
Insights panel.
Here, you can filter your crash events
to show the most recent crashes or crashes
from a specific version of your app.
For each entry, you can see the number
of affected users, the affected device types and Android
versions, and of course, the stack trace, which
allows you to quickly navigate to the place in the code
where the crash happened and get started on fixing it.
You'll also see gutter icons in your source
files, which mark the lines that show up in crash reports.
Click these to view the associated crashes
and their details.
Now let's take a look at updates to design tools and previews.
For Compose previews, you can now
edit the device parameter of the preview annotation
to specify the configuration of the device.
You can choose from reference devices or create your own.
Auto completion will help you with what options are available
and what values they accept.
This works together nicely with multi preview annotations,
which are available since Dolphin.
With these, you can create a single custom annotation
that has previews configured for various devices.
Then, you can use this multi preview annotation
to quickly create previews for multiple device configurations.
While we're at previews, in earlier versions of Android
Studio, you had to manually refresh them
after making changes.
In Electric Eel, previews update automatically
after you make code changes, allowing you
to iterate on your UI faster.
If your code contains compilation errors
during editing, previews are temporarily paused
and then resumed again when the errors are fixed.
You can always see the status of the previews
on the indicator in the top right corner.
To make it easier to track down performance problems,
the Layout Inspector tool now highlights
recomposing composables as those recompositions happen.
This, combined with the recomposition counts,
makes it easy to track down when there are too
many unexpected recompositions happening in your app
and to see which parts of the UI are recomposing.
For example, navigating in the Now in Android sample app,
I can see that the bottom navigation items and the tabs
I'm clicking on are getting recomposed as the selection
changes.
And I can also see the corresponding recomposition
counts changing at the same time.
New for XML layouts, Visual Linting
now runs in the background to check
for issues across different form factors,
detecting problems such as overlapping
or non-visible elements on a given device configuration.
Any issues found in your layout will show up
in the problems panel.
This panel is now a unified place
for all the problems reported by various tools
within Android Studio, including visual linting, navigation,
and compose-related issues.
For example, in this layout file,
we can see two validation problems--
a text view covered by an image view on certain screen sizes
and an image view which is partially out of bounds
in some configurations.
You can open the layout validation panel
to see your layouts rendered for the various device sizes.
Selecting a problem in the problems panel
will highlight which configurations
are affected by that problem.
Moving on, let's take a look at new features around Build next.
The build analyzer tool provides you insights
into what happens during your builds.
This now includes a summary of any dependency downloads
that happened.
You can use this information to determine the impact
of downloads on your build and to spot problems such
as downloads happening during incremental builds when they
shouldn't.
The information here is broken down by repositories
so you can see where each dependency was downloaded from.
You can also see if a repository takes a long time
to serve artifacts or has a high number of failed requests.
If that's the case, you should consider
removing the repository if possible
or moving it lower in your repository configuration
so that other repositories take priority over it.
The Upgrade Assistant that helps you upgrade your project's
Android Gradle plugin version also got more helpful
in Electric Eel.
After performing a version upgrade,
the assistant will attempt to sync your project
and report whether it was successful.
It now also gives you a summary of what steps were executed.
If the project sync fails after the upgrade,
you can use the new revert button
to undo the changes to your build files.
We announced Google Play SDK Index earlier this year,
which provides you information about various SDKs
that you can integrate into your app.
SDK developers can mark versions of their SDKs as outdated
in the SDK Index.
And this information is now shown directly
in Android Studio.
If you're using a version marked as outdated,
you'll see a lint warning on the dependency in your
build file to let you know that you should update it.
Similarly, the project structure dialog
will show the same warnings on the outdated dependencies,
and you can navigate to their Play SDK Index page
from here to learn more.
Last but not least, let's take a look at what's
new with emulators and devices.
First, when creating an emulator in Electric Eel,
you now have the option to create a desktop emulator.
These let you test how your app behaves
on devices such as Chromebooks.
There are a handful of interactions
that are different on these devices
that you should test with your app.
For example, apps can be free form resized or minimized,
which your app should handle gracefully.
Another new option for emulators is their experimental resizable
emulator.
This virtual device helps you test
your app on different screen sizes
without having to run multiple emulators.
After creating and launching a resizable emulator,
you can use the display mode menu
to switch between different device sizes
and see how your app behaves.
Finally, if you prefer testing on a physical device,
you can now mirror the device to Android Studio
and interact with it similarly to how you'd use an emulator.
This is an opt-in feature in Electric Eel.
So before using it, you first need
to go to the experimental page of settings
and enable mirroring.
Then, connect your device through ADB,
either wired or wireless, and it will show up
in the running devices panel.
From here, you can interact with it
much like you're used to with emulators.
Mouse and keyboard events are forwarded,
and you can use the controls on the toolbar to input button
presses or to rotate the device.
You can also drag and drop files onto the mirrored device
just like in an emulator.
If the file is an APK, it will be
installed, which can be really useful for quickly
testing a build.
For other file types, the file will
be copied to the device's Downloads folder.
That's it for Electric Eel.
Download it and start using it today.
You can also already try the next version
of Android Studio--
Flamingo.
Please provide feedback about it on our issue tracker, which
is linked in the description.
Give this video a like if you're as
excited about these new features as we are
and subscribe to the channel so that you
don't miss feature updates.
See you next time.