[MUSIC PLAYING]
CHET HAASE: Welcome to "Now In Android" number 29.
First up, "MAD Skills."
So the series continues to roll along,
and we've introduced a new topic.
We've been covering app bundles for the last couple of weeks,
and we've just today posted the final episode
with the technical content.
But we're not done with the series overall,
and I'll get back to that.
So Wojtek Kalicinski and Ben Weiss
have been posting articles all about app bundles and related
content.
Episode one, "Everything you wanted
to know about Play App Signing."
So app bundles is about uploading something
that is not an APK, which then needs
to be actually created into APKs to download onto user devices.
So part of that means signing those APKs
so that they can be installed.
So it's natural that you should know more about app signing
and how that works.
So this video from Wojtek talks about how
to enable signing for your app on Play Console,
including options for having Google generate the key for you
or uploading a key of your own, if you require that, instead.
Episode 2, "Building your first app bundle."
Ben walks you through all the steps
of actually creating an app bundle, which
you can do either in Android Studio or on the command line,
and then uploading it using the Play Console,
and then using the tools in the Play Console
to inspect information about that bundle.
Episode 3 was about "Configuring your app for Play Feature
Delivery."
You use Android Studio to modularlize your application,
and then also select the modules that you want actually
installed at install time of your application
or, optionally, on-demand.
And Ben also walks through some of the APIs
that you can use to request on-demand module
installation, as well.
And then the final technical episode
is episode 4 from Wojtek, where he
talks about testing with bundletool and Play Console.
So he shows how to use various tools for making sure
that your bundle and your APKs are what you need them to be.
And these include both local tools,
like bundletool, which you can use in the command line,
and related things you can run in Android Studio,
as well as using the Play Console for the uploads
that you put up there, and then the APKs
that are generated from those uploads.
So there is one more episode to come next week.
We are having a Q&A, just like we
did for the previous "Navigation" series.
I will be sitting down with Wojtek, and Ben, and Yuri
on the development team, as well.
And we will be answering your questions about app bundles,
and look forward to talking to them
and talking to you next week.
If you want to check out anything more about "MAD
Skills" as we continue to roll out content--
we've got more technical content,
tons of content still to come--
check out the playlist on YouTube.
There's a link in the Medium articles
that we're posting that are with associated content.
There's also a landing page where
we continue to post all the content for "MAD Skills"
as we go.
AndroidX-- lots of stuff gets posted there
all the time, every two weeks.
Lots of incremental changes to various libraries there.
But there were three libraries that just went stable
that I wanted to call your attention to, in particular.
First of all, ConstraintLayout 2.0.4.
The most important changes there were actually
in the 2.0.2 release, which were really important
for performance.
But go ahead and get 2.0.4 for the bug fixes
that have come in since then.
So the performance gains came from basically the solver
being more intelligent about work that it didn't have to do.
So now in many common use cases, it
can avoid rerunning the solver or re-laying out
and remeasuring things along the way, which
saves in potentially very expensive operations,
especially for situations like deep hierarchies with tons
of views that are gone, which they don't need to be measured,
but it was doing work, anyway.
So that was an important use case to handle,
as well as views-- very typical that views
would choose to be mass constrained, which
is when you set your layout width and height to be 0 DP.
And it also saves time and effort on those.
So these are pretty important.
Performance gains are pretty significant in cases that
ran across these situations.
So definitely grab that one.
Startup 1.0.0.
So this Startup library has been out there
in alpha and beta form for a while,
and now it is finally stable.
It turns out that a lot of applications
use ContentProvider, and more importantly, they
use several of them.
So when they start up, when they initialize,
they would also create several ContentProviders,
and every single one of those takes
a significant amount of time to actually start
up and initialize itself.
So Startup, the library, actually
uses a single ContentProvider, which
means you only take that hit once,
and then it shares out that resource among all
of the requests that come into the API.
So definitely use that for an easier way and a faster way
to initialize and launch your application.
Tracing 1.0.
This isn't a new API, per se, but rather we
moved something out of Core into its own library
because it's a very niche use case.
And you don't need to grab all of Core
in order to just get this tracing capability.
This allows you to easily add tracing calls into your code.
So you can instrument your code, which then produces information
that can be used in Perfetto, which gives you
a good system-wide view of what's going on,
or on some older devices, Systrace.
That's what it started out life as.
Perfetto is the new version of that thing.
And then with these trace commands,
you can find out more detailed information
about what was going on in your application that
can help you debug any performance problems that you
are having at that time.
There's also a helpful Kotlin extension function
that makes it easier to have a very scoped block of code
where you do the trace begin and trace end
around that block of code.
So it just makes it easier to create that instrumentation.
On the article and video front, it's all about Kotlin.
So there were four different topics
that came out in the Kotlin area in the last couple of weeks.
First, Florina Muntenescu posted something, another episode
in her "Kotlin Vocabulary" series,
this one on data classes.
So data classes are a really convenient way for you
to basically have structured data,
where Kotlin provides you a lot of boilerplate stuff
that you don't have to worry about.
For starters, it gives you, automatically,
hashCode() and equals() functionality,
so that you don't have to worry about, well,
I added a new data member, and then you need to update
your functions.
And if you don't update them both correctly,
then problems can occur.
You're not going to get the right result.
It does all of that automatically for you,
so you don't have to worry about it.
It also gives you automatic destructuring of the fields
or the properties inside that data class,
and gives you a copy() function, as well.
There was also an episode in the "Kotlin Vocabulary"
series from Murat Yener.
So he had already posted an earlier episode
on delegates, the Kotlin feature of delegates.
And now this episode talks about the built-in delegates
that come with Kotlin Standard Library.
In specific, the lazy, observable,
vetoable, and notNull.
Then Florina posted an article called "Should I
Learn Kotlin for Android?"
And the answer is, of course, you should.
But for a more detailed and maybe helpful
explanation of why that is the answer, as well
as other related questions and answers that we
get from developers all the time,
Florina wrote this article going over a lot
of important information.
There is also a lot of helpful links in there
for learning resources for people
that do need to actually spin up their development
teams on using this language.
And finally, Florina posted another article
called "Fewer Crashes and More Stability with Kotlin."
And it discusses-- we talk about this a lot,
but this is a bit more detail, with use cases and examples
of why we believe and why we keep saying this--
Kotlin is actually a more robust language to use and less
error-prone, because of features like nullability
at the language level, hashCode()s not being the same
as equals() and more capabilities.
And I will leave that to the article to go into detail.
And then finally, there was a single "ADB" podcast
episode that was posted just this morning,
as I am recording this.
Romain, Tor, and I talked with Colin White from Instacart.
He has an open-source library called
COIL, which stands for, not Kotlin Image Loading,
but Coroutine Image Loading.
And we talked about all kinds of stuff.
We talked about that library, but we also
talked about Kotlin, and coroutines,
and the choice of those for this library and that functionality.
In particular, we talked about performance.
We talked about images and image loading.
So interesting conversation.
Check that out for more information about that library
and about Android in general.
And finally, as usual, all of the links
to everything I talked about are in the article,
so check out the Medium article for those.
And if you like the video, go ahead and like and share,
and subscribe to the Android Developers channel on YouTube.
Thanks.
[MUSIC PLAYING]