[MUSIC PLAYING]
CHET HAASE: Welcome to "Now in Android," episode 28.
First up, "MAD Skills."
So the first series of "MAD Skills" has completed.
"MAD Skills" is, of course, the series of content
that we are creating to teach you
how to use the various pieces of Modern Android Development
to make it a lot easier to create better applications.
So the first mini-series on Navigation component
just finished, almost.
So tomorrow-- I'm recording this on Wednesday.
On Thursday, we're having a live Q&A.
This is important because it's basically
the first one of these that we're hoping
to do for the entire series.
The intention with the entire "MAD Skills" series
was not just to dump a bunch of content
out there, which hopefully you all can learn from,
but also to interact.
Are you having problems?
Do you have questions about how this stuff works?
So after each of the mini-series,
starting with Navigation, we're going
to have a live Q&A where I will be asking
questions of domain experts.
Tomorrow, I will be talking to Ian Lake,
the engineer behind the Navigation component.
I have reached out to Twitter and gotten a bunch of questions
to ask Ian about.
We'll have a conversation about how things work.
And hopefully, you can join us for the live one.
Except you're probably seeing this video after it
already happened.
So I'm mentioning it here because A,
there will be a video of it that you can check out
and you can see what the Q&A was like that you
couldn't join on time.
And B, because I want you to try to tune
in for the future series, which I'm giving you
notice for now, so that you can't tell me later
that it was too late.
So join us tomorrow if you can magically do that,
and certainly join us in the future.
And in the meantime, think about those questions
that you have for each of the mini-series that we
are posting.
Next up, we have AndroidX.
So couple of things going on in AndroidX.
First of all, we posted more libraries out on GitHub.
So we have heard from you that you
prefer using GitHub as a source repository solution,
versus the AOSP and Gerrit solution, which
is a lot more effort and a lot more
uncommon for your normal workflows.
We totally get it.
However, it is very difficult for us
to just move over to GitHub because of infrastructure bits
that we rely on internally.
However, we are taking a look at the situation.
And we have made some of the libraries available externally
to hopefully make it easier to interact
with these actively-developing libraries.
So already we have Paging, Room, and WorkManager
available at GitHub, and we have recently
also added Activity, Fragment, and Navigation.
So go ahead and check them out.
And if you want to contribute, there
is a contributing doc on that site--
link in the article--
and you can see what you need to do
to actually be a part of contributing
to those libraries.
There were stable releases that came out
for AndroidX-- a handful of those, mostly minor.
I did want to call your attention to MediaRouter 1.2.
This one is interesting because it
integrates some of the functionality
that we enabled in Android 11.
So one of the things we did in Android 11
was to take a lot of the media information
and put it into a dedicated space in the notification
panel.
So before, you had the ability, as a user,
to control the media-playing experience,
but these were notifications that
were interleaved with all of the other notifications
on your device.
Now we have a dedicated media space,
that resides right below the Quick Settings,
where all of the media information is.
You don't have to do anything new to take advantage of this.
This is just a new user feature in Android 11.
So if you're already using MediaSession and MediaStyle
APIs, which came out around Lollipop,
then you should be set.
They should just populate the UI in the appropriate place.
But there was also some new functionality
added in Android 11 for seamless media transfer that
makes it easier for your users to change the playback device
where the audio is coming from.
This is new functionality in the platform that also has new API
functionality, and MediaRouter 1.2
plugs into that new capability for the platform.
So check that out if you want to take advantage of that.
There were also a bunch of alpha releases, and beta, and RC,
as there usually are.
I normally don't go into detail on the alpha releases,
unless it's a brand-new thing.
But I did want to call your attention to a couple, which
are sort of an interesting milestone going forward.
So one of the questions that we've gotten a lot recently is,
as developers look at the active development going
on in architecture components-- things like Lifecycle,
ViewModel, Paging, Navigation, whatever it is--
they think, well, yeah, but then you have this Jetpack Compose
thing coming out, so why would I spend my time on this
if, obviously, there's going to be a new solution there?
And the answer is, because there's not.
We are trying to solve architectural problems,
hard architectural problems, with the architecture
components.
And we expect all of that stuff to carry over
into the Jetpack Compose world.
Most of this stuff, much of the functionality
in these libraries, has nothing to do
with views, and the view hierarchy,
and the existing toolkit system.
So it should just transfer over.
We just need to figure out the details of the APIs
and how you access that in new world.
So we are doing ongoing effort in all of those libraries
to figure that out, and we have some early results
along the way.
So ViewModels and LiveData already
have examples of this in their libraries,
where they integrate with Jetpack Compose.
And just recently-- in fact, just this morning,
a couple of hours ago--
Paging and Navigation came out with their first approaches
to integration with Jetpack Compose.
So check those out.
"Kotlin Vocabulary," of course, is an ongoing series
of content--
videos and articles-- teaching how various language features
work in the Kotlin language.
There were some new articles and videos posted on that.
First of all, Florina Muntenescu posted a new article
and a video on destructuring.
So destructuring is a convenient way
to assign values from multiple fields in a class or an object
to multiple variables.
It's just kind of a nice way to assign
multiple values all at once.
You get this capability automatically from data classes
in Kotlin, and the article and video show you how to do that.
But you can also build in this capability
to any existing classes.
You can even add extension functions
to build in that capability into arbitrary classes
that you want to.
Speaking of extension functions, Meghan Mehta
has released a new article on how extension functions work.
This is probably my favorite feature of Kotlin,
because it allows you to keep improving APIs.
So maybe you don't have access to the String class directly.
But you can add an extension method
and basically insert a method that callers
can call as if it actually existed on that String class.
So kind of a nice way that makes the end resulting
code in applications a lot more readable and usable.
Let's see.
Moving on to coroutines.
So there was a new article and video--
sorry, just a video-- published by Manuel Vivo
on the ABCs of coroutines.
So he talked specifically about how
things like coroutine scope, coroutine contexts,
dispatchers, and jobs work.
So maybe not so much the ABCs as the CCDJs of coroutines.
Articles and videos-- there were other articles and videos
worth checking out.
First of all, there is one from the Play
team about common policy violations
and how to work with them, how to do the right thing
for your application.
So this is a really tricky area.
We are trying to do the right thing on the Play
Store for users in making sure that apps are not doing things
that users wouldn't get a good experience from.
But it can be difficult from the outside,
as a developer, to tell if you got flagged,
what exactly the problem was, and then how exactly you
are supposed to fix it.
So they published this article to help,
flagging several of the common violations that they have seen,
along with information about how to deal with those.
Examples include UI that links out to the Play Store.
Descriptions of apps that are really more
focused on search terms than they
are on summarizing what the application does.
And also, a really common one is some apps
are basically nothing more than a thin WebView
wrapper around a website.
Well, that's not the intention with applications on devices.
That doesn't bring a good experience to users.
Instead, we want it to actually be an Android app that provides
a good experience for the user.
So these are three of the things.
There's more in the article, so check that out
for more details.
There were a bunch of videos posted from a recent Droidcon
conference.
So Droidcon did something interesting this time around,
where besides just having online presence for their events,
they also combined a bunch of events.
So rather than there being, let's say, a Droidcon London
this year, there was a Droidcon EMEA,
which was basically a time-zone-friendly version
of Droidcon.
That happened a few weeks ago.
A bunch of us gave talks there.
A bunch of people in the external community
gave talks there.
Thank you.
And there's a lot of information that's
posted in videos on the Droidcon site,
so you can check those out.
"Motion Tags" is an ongoing series
of screencasts that shows you how
to use the various tags in the MotionLayout API,
as well as editor.
So there were two episodes that came out
in that series recently.
Episode 7 goes into details on KeyAttribute,
which is where you put information
about properties of the view, things
like transform and alpha.
Episode 8 covers KeyCycle.
So this has very similar information
as does KeyAttribute, but also adds information
about the waveform that can be used during an animation.
Changing that waveform allows you
to create really complex and interesting animations.
Because this can be tricky to use,
there's also a standalone tool that we
created that can make it easier to actually edit and create
these things.
So you can check out the playlist
for "Motion Tags" for all of the episodes,
and certainly, the two new ones that just came out.
In the training space, there was a new course that came out.
Specifically, the new Android Kotlin Developer
Nanodegree from Udacity.
This helps you learn best practices for building
Android apps in Kotlin.
I should point out that the Nanodegree is a paid service,
because it's not just course content.
Instead, it also provides projects
with feedback, mentorship support, and career services
from Udacity.
However, the underlying content that the Nanodegree
is created from is free.
We work with Udacity on creating that content, as well
as the overall Nanodegree.
And so you can access that.
If you just want access to the content,
you can check that out with the links in the article.
Finally, one podcast posted since the last "Now
in Android."
It was the podcast on Paging 3, just posted this morning.
Romain and I chatted with Dustin Lam and Chris Craik
from the Toolkit team about the Paging 3 rewrite.
So it was a complete rewrite of the library in Kotlin,
taking advantage of things like coroutines and flow
for this inherently asynchronous behavioring library
and technology.
So they talked about why they did
this, what advantages it has.
Most of those are internal.
I should point out that when I first
heard it was being rewritten in Kotlin,
I wondered if that meant that you would need to be writing
code in Kotlin to access it.
And the answer is no.
It does use coroutines and flow.
A lot of that is internal.
It made it easier to write more elegant and better code
internally.
And some of that is exposed as API for Kotlin developers.
But there is also API that you can access from the Java
programming language, using RxJava, for example,
or other approaches for asynchronous programming.
So check that out for more information on Paging 3,
on Kotlin, on API design.
We had a wide-ranging conversation there.
As usual, all of the links to everything I talked about today
are in the article, so check that out for the details.
And finally, if you liked the video,
go ahead and like, and share, and subscribe to the Android
Developers channel on YouTube.
Thanks.
[MUSIC PLAYING]