[MUSIC PLAYING]
JAMAL EASON: Hi, and welcome to our session on What's New
in Android Development Tools.
I'm Jamal, the Director of Product Management
on the Android Studio team.
TOR NORBYE: And I'm Tor, the Engineering
Director for Android Studio.
JAMAL EASON: Today, Tor and I will
talk to you about three things.
First, I'll walk you through some
of the features you may have missed since we last
spoke with you.
And then Tor will give you a demo
of some of the latest features.
And lastly, I'll conclude by going
over a few additional product updates.
OK, let's take a look at the roadmap.
First, we'll talk about Android Studio Flamingo
that we released to stable just the other month.
In this release, we launched traffic interception
as a new addition to the Network Inspector.
You can now select a time range in the network timeline
and create rules to inject network headers, status codes,
and more.
Next, we added themed app icon preview to our design tools.
You can choose from a number of preselected, dynamic
backgrounds and preview how your themed app
icons will respond to wallpaper changes on Android 13
devices and higher.
And lastly, SDK extensions allows Google
to add APIs to a public SDK.
You can utilize these APIs in your apps
to provide additional functionality that
wasn't originally available in the SDK,
like Privacy Sandbox and Photo Picker.
As you develop, Android Studio Flamingo
has lint support to help you choose [? ethic ?] extensions
correctly.
Overall, this was a smaller release
but packed with quality enhancements
such as an update to the IDE to be composed
first, which includes new project templates to be Jetpack
Compose and Material 3 by default,
plus a host of smaller quality improvements
to make development for Jetpack Compose even easier.
Now, alphabetically, this brings you up
to speed to our latest releases-- android
Studio Giraffe Beta and the Canary release of Hedgehog.
Before talking about these, I'll have
Tor give a quick demo of some of the tools in action.
[MUSIC PLAYING]
TOR NORBYE: Thanks, Jamal.
Let's jump right into it.
So the first thing I want to show you
is our target SDK migration assistance.
Here, we have an app, which is not targeting the latest SDKs.
There's now a quick fix which analyzes your app
and then creates a customized set of steps to follow.
So here, you get detailed guidance
on how to update your app.
We've had these steps documented on our website before,
but here, they're integrated in your IDE flow.
And more importantly, this list is shorter than the online one
because we analyze your app, and we filter out
steps that don't apply to your code base.
We even add some helpful links to point you to relevant code
locations, such as where to update this Bluetooth
permission.
All right, let's talk about Compose.
Jetpack Compose is production ready,
and in Studio, for new projects, it's now the default.
We're also switching the default build script language
over from Groovy to the Kotlin DSL.
And we've continued working on making Compose preview more
reliable and faster.
Here, the previews are packed in a grid layout,
and I can see how this screen adapts across device classes,
like foldables and tablets.
And now let's run this app.
For that, I'm going to connect my phone to the computer.
[SNAP]
And as soon as I do, I get the new device streaming window
in Studio, so I can put my phone down and interact with it
directly from within the IDE.
So we'll run the app.
Here it is.
And let's click on an email.
One of the features we're working on
is an integrated Layout Inspector.
So I can click to launch it from the toolbar.
And within four or five seconds, which
is much faster than before, we now get the view hierarchy.
And I can inspect the live UI, and I
can click to select a view, and I could even
Alt-click to jump to the corresponding source
in the editor for the app running on my phone.
I can also start editing my code.
So, for example, I'll uppercase the email text.
And when I hit the Save keyboard shortcut, Control-S,
Live Edit kicks in and nearly immediately
updates my code running live on my phone.
OK, now I'm going to click on the Reply button
to trigger a crash.
Yep, the app died, so I have a bug in my app.
So let's open up Logcat to take a look.
So here's our crash, and there's a new feature where I can just
right-click on this crash and ask for Studio to explain
what this error is.
And this opens up Studio Bot, our new AI-powered chat
bot which is directly integrated in the IDE.
So here, we're talking to a large language model,
and we're getting an explanation for what
crash is and a description for how to solve it.
Notice also how it's recognizing and highlighting code snippets,
like this manifest XML fragment.
By having this in the IDE, it's following my own color styles
and theme preferences.
By the way, you may have noticed that this whole IDE looks
pretty different, and that's because I've
turned on the new IntelliJ UI, which you can
find in the Settings dialog.
This is a fresh, more modern look
for the entire IDE, where everything is more streamlined.
The toolbars and the window layout have been reworked.
We have new icons, and there are new editor colors
with a bit more contrast.
It took me a couple of days to adjust and get productive
with it, but now I like it so much that I can't go back.
Anyway, back to Studio Bot.
In addition to getting answers, in Studio,
we're enriching the answers with local smart actions.
So, for example, here, we're being
told that we need to add a permission to the manifest.
And to do that, I can just click this button.
This locates the primary manifest
and merges the XML fragment in, adding it
in the right logical place in the manifest.
We can ask Studio Bot to generate code too.
Let's try the following query--
"Write a data class for a Cartesian coordinate
with plus and minus operator methods."
Here, it's written a data class for us,
and it's also giving us some usage information.
One thing I can do is click to open this into a playground.
And let's also open up the usage examples
in the same playground.
And now when I evaluate this buffer,
I can see, for example, that the addition
method is working correctly.
But let's not test it manually.
Let's have Studio Bot write a test.
So, "write a unit test for this."
This is a follow-up question to the previous one,
and it understands that I'm referring to earlier code.
And here's our unit test with tests
for the coordinate methods in the earlier answer.
So let's go and actually add these files to our project, not
just a playground.
So first, I'll add the class.
It puts that in the source tree with a package,
and then I'll add the unit test.
Notice how Studio has figured out
that this is a test, so it's added it into a test source
set.
And there's something else subtle going on.
The code snippet from the large language model
doesn't have any imports.
This is something we've done in Studio.
We're figuring out how to resolve imports
by using our available code indices in the IDE,
as well as a simple database for well-known libraries.
And we're adding the implicit imports on the fly
so that the code works out of the box.
So let's try this code.
We're exploring some local IDE actions,
so I'll set a breakpoint on line 6.
That added the breakpoint, and then we'll
say, debug this test.
So this finds out that I'm supposed
to be running the CoordinateTest and launches it.
The last example I'll show is how
to use the assistant with naming.
So, "suggest a better name for the Coordinate class."
So here are some suggestions.
I do like Point better than Coordinates.
So let's trigger a renaming for this.
Triggers the IDE refactoring, preconfigured
with the right selections.
And I can apply their factoring in.
Here it goes.
So that's Studio Bot, which we're actively working on,
and it's pretty exciting to see how much it can already do.
And with that, I'm going to pass it back to Jamal
for some more updates.
[MUSIC PLAYING]
JAMAL EASON: Now that you have a sneak peek of some
of the tools in action, I have a few more feature updates
to share with you.
Previously, we released the integration
of Firebase Crashlytics in App Quality Insights.
Crashlytics typically requires you to instrument your app
to get deeper insights.
To add to this integration, we are
excited to launch the integration of Android Vitals.
All you have to do is publish your app on the Google Play
Store, log in to Android Studio, and open App Quality Insights
to access crash data from a broad set of devices
so that you can improve the technical quality of your app
right in the context of your IDE.
For those using App Actions, we have also updated the Google
Assistant plugin.
With this plugin, you can create a preview of your App Actions
for the Google Assistant and create an environment
to test how your App Action handles parameters
without having to submit your app to the Play Store.
Another update you don't want to miss is the new Power Profiler.
We know that understanding the battery impact of your app
on a device can be tricky.
Our previous Energy Profiler approximated the impact
based on a mathematical model, which was close,
but we wanted to do better.
To that end, we updated the Power Profiler
so that you can visually see the power consumption of the device
all the way down to the hardware component level,
with your app running in either the foreground or background.
Next, the Device File Explorer.
In the latest update to Android Studio,
we updated the name to Device Explorer,
moved the file exploration into a tab,
and added a new tab called Process,
which allows you to see all the running processes you have
access to, attach a debugger, or force quit a process
to test how your app reacts.
For those developing for Wear OS,
we have a few exciting updates.
Alongside the release of the Wear OS for emulator
with Bluetooth support, the updated emulator
also allows you to run watch faces built with the new watch
face formats.
With this new XML-based format, you can just
define the look and corresponding resource,
and Wear OS will take care of the rendering.
You can get started with watch face format
by using Samsung's Watch Face Studio.
Now moving on to build.
We are expanding the support of Gradle Managed Devices
by integrating with Firebase.
Instead of only relying on local devices,
you can now deploy your automated tests
to a hosted set of devices and Firebase Test Lab using
this new Gradle DSL API.
And if you're working on large-sized projects,
you do not want to miss enabling Gradle configuration caching.
Using this feature allows the build system
to record information about the build task graph for your app
project and then reuse it in subsequent builds.
Turn it on by analyzing your build with the new Build
Analyzer.
Notably, the Build Analyzer will not only
turn on the feature for you but also
give you an estimate of the amount of build time
you will save with each suggested build change.
Speaking of time savings, Square turned on Gradle configuration
caching for their Android app, and they told us
they saved over 5,000 hours in build time,
which translated to recovering over $1,000,000 in lost
productivity.
Wow.
Your exact impact may vary, but check it out.
And for the last update for build,
let's talk about baseline profiles.
We have heard of dramatic improvements in app startup
time of upwards of 60% using baseline Profiles
with the latest Android Gradle plugin and Android Studio,
it's even easier than before to get started.
We have a new baseline profile module template
and configuration in the IDE.
And to help in maintaining profiles,
Gradle can now create multiple baseline profiles as well.
And lastly, if you do find a bug in Android Studio,
we have an updated logs and diagnostic tool
that will generate the right set of data points
we need from you to better troubleshoot issues.
Once you have generated and reviewed the logs information,
please attach these data points to the bug
reports that you send to us along with repo steps
so that we can better understand and troubleshoot your concern.
OK, great, that's it.
To recap, we showed you a range of new features
from both Android Studio Giraffe and Hedgehog,
from Studio Bot to updates to Live
Edit, integration with Android Vitals, and a fresh new UI.
As you know, you're able to run your project
with both a stable and preview version of Android
Studio at the same time.
So please try out these features to give your early feedback.
[MUSIC PLAYING]
Thank you for watching our session
on What's New in Android Development Tools.
On behalf of me, Tor, and the rest of the Android Studio
team, we hope you enjoy what you see.
Download the latest update today.
Thanks.
TOR NORBYE: Thanks.
[MUSIC PLAYING]