WOJTEK KALICINSKI: Android Studio Bumblebee, also known
as version 2021.1, is now available for download.
This release brings a lot of UI polish, and new features
in various parts of the IDE, such as profilers, inspectors,
design tools, and more.
There are also many internal changes, including
the new resource shrinker, lint build cache
support, a unified Gradle test runner
for more repeatable tests, and new Android Gradle plugin
APIs for plug-in and library authors.
Let's see all of those in more detail.
First, for users of Compose, our next generation UI toolkit,
Android Studio Bumblebee brings interactive preview.
When turned on, it lets you test interactions, such as taps
or animations, on your preview composables
and see the effects right in the preview window.
Taking a step back from Compose and into the world of XML,
Android Studio's layout editor and layout validation tool
gained a set of pre-defined reference devices
that let you quickly preview your screens
on a variety of form factors, such as phones, tablets,
and foldables.
If you use animated vector drawables in your apps,
we have another tool for you.
The AVD Animation Preview, which lets you
quickly play those animated drawables in the IDE.
That's quite a lot of options to preview
your work without even having to deploy your app to a device.
But once you decide to do it, Bumblebee now
offers a new device manager UI to help
manage both emulators and physical devices.
You can access it here on the right hand side
to see a list of devices, as well as create new ones.
When running an emulator, you will
notice it now appears embedded in the Android Studio interface
by default, which you can change in settings.
On the Physical Devices tab, you can see attached devices
and initiate Wi-Fi pairing for ADB debugging without requiring
a cable connection.
To use wireless debugging, generate a QR pairing code
with Android Studio, and then just scan it
with your Android 11 or higher device, and you're connected.
Let's switch to some of the inspectors and profilers
that you can use to debug and improve your app,
as we have quite a few changes in this area.
First up, the layout inspector gained two new features.
For Compose, you can now inspect semantic information,
which is used for accessibility and testing.
To find views that have semantic information attached,
select Highlight Semantic Layers.
Now click on any of the layers that are not grayed out.
Here for example, you can see both the buttons
own declared semantics, as well as
those that were merged in from its child view.
If you want to save the current state of the layout inspector
so you can come back to it later,
you can now export a snapshot from the layout inspector.
To open it again, simply go to File, Open, and select the file
you saved in the previous step.
Moving on to other minor changes in app inspectors.
The Background Task Inspector now
incorporates information previously
available in the Energy Profiler.
Namely jobs, alarms, and wakelocks.
And the network profiler is now the network inspector
and can be found on the App Inspector tab.
Speaking of profilers, Android Studio Bumblebee
brings support for the new profileable manifest flag,
which lets you use certain profiler features with apps
that are not debuggable.
Up until now, there was no way to profile apps
without the performance overhead of debugging symbols.
With a profileable flag, apps can now
run with performance that is as close as
possible to the release version.
To use it, its best to create a new build type.
Give it a name, such as Profileable, for example,
and set the debuggable property to false.
Then in the Build Types Manifest,
add the profileable tag like so.
Now select your new profileable variant and run the app.
Then connect the profiler as usual.
Note that only CPU and memory profiling can be used,
and some functionality of the profilers
will not be available, such as non-native allocation
tracking, initiating heap dumps, event timeline,
and API initiated traces.
The CPU profiler got some updates in Bumblebee.
It uses Simpleperf to capture traces by default.
You can now collapse nodes that are not
relevant for trace analysis and use the new frame data track
for easier junk detection.
The Android Gradle plugin version
that comes with Bumblebee is 7.1.
It contains a new test runner that
will now be used by default when running instrumentation
tests from Android Studio.
This improves the consistency of your test results
when running tests from the IDE, command line, and CI server.
It shouldn't have any impact on how you write your tests
or run them from the IDE.
However, if you do find any problems,
please report a bug so we can investigate.
The AGP Upgrade Assistant received UX improvements,
and can now migrate deprecated DSL forms of properties
to their new forms.
So please migrate before the old syntax
is removed in Android Gradle Plugin 8,
as outlined in our AGP roadmap.
When creating new projects, the Android Gradle Plugin
is now configured to use nontransitive R classes
by default. In short, this can avoid unnecessary recompilation
of unaffected code whenever a resource is added or removed.
It does mean, however, that you now have to refer to R classes
by their proper package name, and not
by the package names of their parent modules,
as they will no longer resolve transitivity.
Here are some more changes in AGP.
The new resource shrinker now works with feature modules.
The lint task is cacheable so incremental builds are faster.
And more parts of the Variant and artifact APIs
for Gradle plugin authors are stable.
Plus, you can now get access to even more build artifacts.
We just concluded a series of MAD Skills videos and articles
on the topic of extending your builds using these APIs.
So please check them out if you're
interested in this topic.
And finally, for authors of Android libraries,
we extended publishing support with the ability
to configure variants and optionally include
Java docs and sources.
Please refer to our release blog for more information
about Android Studio Bumblebee.
Help us test your projects with the next iteration of Android
Studio codenamed, Chipmunk, and file
any bugs and feedback on our issue tracker,
linked in the description.
Hope you enjoy the new features and fixes.
Until next time.