[MUSIC PLAYING]
SPEAKER 1: Hi, and welcome to another episode of "Now
in Android."
This is episode number 12, which is really logical
because last episode was episode number two.
So let me explain what's going on.
This is actually episode 12, and episode two is actually
episode 11, and episode one is episode 10.
I had been naming the articles according to their episode
number for a while, and then I switched to dates,
and then we started the videos and they had their own numbers
because they--
it all got very confusing.
So now, the article says episode number 12,
the video for that article says 12, the podcast also number 12.
Or there is a conspiracy theory that, in fact, we
do have episodes three through 11 in video and podcast form,
but they were too dangerous to let out into the universe.
You can take your pick.
Anyway, on with the show so lots of things
happened in Android, of course, in the last couple of weeks.
First of all, AndroidX releases.
There were some stable releases that were basically bug fixes.
So fragments, library, the media2 library, Navigation,
and work manager.
There was also core 1.2.0.
It had some interesting features and API changes in it,
so you could check that out, that is now in stable,
including notifications.
Also making blend modes that were new in the Q release
actually work on older releases through that magic
compatibility thing, and shortcut info and also
window insets.
And then finally, ViewModel Saved State 2.2.
This is a huge new release with functionality of really
not much.
Basically, this just changed the numbers
so that it syncs up with the version numbers
of the rest of lifecycle.
Kind of like I'm updating the numbers of these episodes
so that the articles sync with the video and podcast,
same thing there.
So 2.2.0 is the same as 1.1.0, but with different numbers.
All right, also in the AndroidX world
we have hitting alpha for the first time is emoji 1.1.0.
It has some new emojis from Unicode emoji version 12
as well as 12.1.
So if you want those new emojis in your app,
this is a good way to get them.
And Navigation 2.3.0.
This is interesting for a couple of reasons.
One is there is a new artifact for navigation testing, which
is important, obviously.
And also, there's new dynamic features navigation.
So let me segue to the next section,
and we'll find out more about that.
So what is better than having a new API?
How about having an existing API that does new things.
So Wojtek Kalicinski and Ben Weiss
have been working on functionality for Navigation
that will handle dynamic feature modules.
So essentially, you get to use the same Navigation API where
you navigate to things, but some of those things
can be parts of your code that are not actually
loaded-- some of those parts of your application
that are not yet installed.
So a little bit of background.
First of all, application bundles.
Android app bundles is a new application bundling format
that we came out with a few months ago,
and it is the way that Android developers should be bundling
and releasing their code.
So instead of sending several APKs
with different configurations up to the Play Store,
instead you send one app bundle up to the Play Store,
and then the Play Store can then divide this
into the subsections, the subsets of your functionality
that is needed for any particular device
and configuration that it needs to install that onto.
At the same time, you can take advantage of a new feature
the Play Store and Play Libraries
offer called dynamic feature modules, where
you can have that core module that gets installed initially
that has all that core functionality that
needs to be there when the app first launches,
and then you can have other additive
things which are maybe optional flows for the application.
They don't need to be there at first--
assets that aren't part of the initial flow, whatever it is--
so you can make your initial download smaller
and then download and install these other pieces
as necessary.
So there is a Play Core Library where
you can handle the downloaded installation of these things
manually yourself-- and you can certainly check out that API.
Basically, it's got callbacks--
I'd like to do this thing, and then you could call back later
and you can check the status of stuff like that.
Or you could choose to use the new library that
is in alpha form in Navigation where
you can tell your application to navigate to this thing,
and this thing may be in one of these feature modules.
And the Navigation library--
the new API that's out there--
will handle the details of actually downloading
and installing that for you.
If you want to check this out, as I said, it's an alpha form.
So maybe not ready for prime time for your application,
but they are looking for feedback on that.
So please do check it out.
There are docs for this as well as a sample
that just got posted last week.
So the links for these as well as
everything that I talk about in these shows are in the article.
So check out "Now in Android" number 12 to check out
the details for those.
There were a couple of interesting articles
that you may want to take a look at.
One was called "Zero-Cost Abstractions in Kotlin."
This is part of Florina Muntenescu's series
on Kotlin vocabulary.
In this one, she talks about inline classes,
which you can use for type safety
without all of the overhead that you would think is associated
with creating classes.
And also, Android Styling.
There's a new series from Nick Butcher called Android Styling.
And this first episode in the series
is called "Themes versus Styles,"
and he goes over the differences between the two
from the outside, and frankly, even from the inside.
They kind of look like the same thing, right?
They both use style tags, so what's the difference there?
They are pretty hugely different.
You use them in very different situations,
and Nick covers a lot of the differences in this article.
And there will be ongoing future articles that
add to this series and add to our knowledge
of themes and styles.
A lot of the stuff from the article-- but not all of it--
comes from a talk that Nick did with Chris Baines at ADS,
so you should also check out that for good background
in themes and styles.
And finally, we add a new podcast for ADB--
Android Developers Backstage.
We talked with Mike Nakhimovich from Dropbox.
He is working on a library whose latest version is now
in alpha stage.
And he's working on this partially
with the help of Yigit Boyar.
And we talked to both of them on the podcast.
So there is this pattern that we refer
to in the opinionated guide on architecture
for Android called the repository pattern.
So it goes like this--
let's say you need to store your data on device-- maybe you want
to use a room API in conjunction with the other architecture
and components, but maybe you also need
to occasionally retrieve data from the network.
Wouldn't it be nice if your application
didn't need to know about where that data was coming from?
It could just call a single API, and then pieces underneath
could determine whether it was coming from a local cache
or coming from the network.
That's the repository pattern.
But we didn't implement the pattern.
That is not a library that we offer,
it's more of an idea of a library.
You can think of the Store library
as an implementation of that idea.
So they've taken a lot of those architectural design ideas
and put them into an API, so that you can now
ask this library for that data and the library
will do the right thing after you configure it in your code
to actually reach the correct local and network pieces.
So that is currently in alpha.
Again, maybe not ready for prime time, but definitely worth
checking out.
And also check out the podcast.
And that's all we have for this time.
If you like this video and other videos like it,
please like and share and subscribe to the Android
Developers channel.
And I'll talk to you next time.
Thanks
[MUSIC PLAYING]