[MUSIC PLAYING]
CHET HAASE: Hi, I'm Chet Haase from the Android Developer
Relations team.
Welcome to "Now in Android" number 13.
So 13 is weird.
Hotels don't feel like posting that floor because people
don't like the number 13, some sort of superstitious thing.
If you have that issue with 13, like if you avoid
13th floor, the last donut in a baker's dozen,
or when you're just counting by one
and you pass 12 before you get to 14--
if you have a problem with it, you can skip this episode
and just come back when we have number 14 next time around.
And then just pretend that since it's software,
there was an off by one error if that works for you.
In the meantime, tons of things have happened
in the last couple of weeks.
There's a lot to cover.
So go ahead and crank this video or podcast up to 2X,
and let's get rolling.
First of all, obviously Android 11 is out on the streets
now, so developer preview one.
When we first did developer previews--
Lollipop was the first release that we did that--
it was a really good idea.
It was a really poor implementation.
Because things were undergoing massive churn at the same time
as we released that.
And then since then in the releases, many releases
since then, we sort of learned how to do it better and better.
We get it out there in a fairly stable form
so that we can get your feedback and then react to it.
This one is coming out even earlier than we
have in earlier releases.
So that means that there should be
more time for you to actually play with it and react to it.
So please do that.
Go ahead and download it.
You can install it on any of the Pixel 2, 3, or 4 devices
if you want to put it on a developer device,
or just use the emulator in the Android Studio tool.
That will work as well.
So play with it.
Test out your app.
Make sure things behave the way that you think they should.
Some of the features that are worth thinking
about in the new release that are in the developer preview
are support for 5G.
This includes some new APIs that allow
you to check the unmetered status
and with the bandwidth capabilities
that come with that new network capability.
Bubbles was a feature that was introduced in Android 10--
kind of.
It came out, but it came out under the guise of a developer
option.
So a user had to enable it to actually see Bubbles.
So we got a little bit of testing.
Hopefully you got a little bit of testing
if you wanted the feature, but it wasn't really
a real feature for users.
Now it is.
It's an official API that you can and should
use for UI about messages, about contact information
that you want to propagate to the overall UI on the device.
One-time permission, so there was a tri-state location
permission that we introduced in Android 10,
the ability to ask the user, do you
want to enable this permission or deny this permission
or only enable it when this application is
in the foreground?
That was a really good idea.
Users liked that.
They used that a lot.
And we want to take that a step further, so not just
running in the foreground but, do
you want to use this while the application is running
in the foreground in this session only?
So it's not like a turn this thing on,
and then the app has it forever.
It is turn it on because I recognize
that it needs to be used right now,
and then disable after that foreground usage.
Not only are we going to have that for location,
but we're also turning on that permission
capability for microphone and camera usage as well.
Scope Storage, we're taking that a notch
further than it went in Android 10.
We're enabling some new capabilities
that are interesting and will hopefully
make it a little bit easier to use some of this stuff
and more powerful.
You have the ability to do batch edits
and also access to raw files and paths.
There's been some new biometric prompt APIs
according to some of the new capabilities that
are out there for some of the new devices in the world.
And we've also folded those in for compatibility APIs
into the biometric AndroidX library.
So check out those APIs.
And data blobs, I think that is probably my new favorite word
in software.
Blob apparently stands for binary large object,
but I just like it as the word blob.
Data blobs are large chunks of data
that you can download and install
for use between multiple apps.
So let's say you have a massive ML model,
you want to put it on the device,
and you have multiple apps that want to access that data.
You don't need to install it for both of them.
Instead, you can use the Blob Store Manager
API to share that data around.
So check out Android 11, download the developer preview,
and play with that.
On with the show, AndroidX releases,
there were some basically bug fix releases
that came out for Fragment, Media2, Room, and Transition.
All of those are stable in their current version now.
Mostly bug fixes but also the fragment library
had some interesting lint checks that you
might want to check out.
Next Android Studio, so we had a couple of interesting releases
there.
I've talked about both of these releases in previous
Now in Androids.
But first of all, we have 3.6.
That finally went stable.
So now you can get all of those features
that we've been talking about already
except in the stable version.
So if you were holding back waiting
for it to actually be the full release thing, now is the time.
Some of the new things that you may be interested
in there include easier leak detection--
it can be a complicated task, especially
if you have to download files and run specialized tools,
so that is much easier now in 3.6--
also split view for code and design.
So if you're editing a resource file,
an XML resource file, typically you would see it in code
or you could use a design tool when that's available,
but one or the other.
Now you can actually see both at the same time.
So you can sort of see the changes
that you make to either format and see
them reflected in the other one, pretty useful.
Emulator improvements for working with both location
as well as multi-display situations and view binding,
which we're going to hear about soon--
this is a new capability in 3.6.
You need the new tool to use this thing that essentially
replaces the need for find view by ID
and all of that boilerplate code.
Also, 4.0 went beta.
So you can either use the full release with 3.6,
or if you want to be slightly more on the leading edge,
you can use 4.0.
So check that out.
The Motion Editor I've talked about here
before, the ability to actually use
a visual tool for creating these powerful UI
animations with the ConstraintLayout
subclass or also Jetpack Compose.
If you want to see what we're doing
with the new UI capabilities in that library still--
pre-alpha, still pretty early, still undergoing changes.
But you will need 4.0 if you want to play with that,
so if you want to do the tutorial and sample
code that we have online or play around
with any of the ideas in some of the talks
and our articles that have been posted about that.
Next, background location, so what
are the three most important things for user privacy?
It's got to be location, location, location.
So it's really important to make sure
that the user not only gives the appropriate permission when
their location is going to be used
but also knows what's going on in the system.
There have been a bunch of changes
for privacy in the last few releases
where we were trying to make that clearer to the user
and to developers exactly what the rules are
and when applications and developers can get access
to that location and how the user can find out
that that access is happening and either grant or deny it
appropriately.
So we are continuing to make changes in location
with each release, make sure that this is the right thing
to do for users.
And we created a new guide.
We know that it can be complicated to deal with all
this information, make sure that while I actually do
need the location in the background,
how do I get that location, and how do I propagate
that information to the user?
So there's a new guide on the site that you should check out.
This link, as all links that I talk about,
I'm not going to give you a URL.
That would be silly.
Instead, go to the article, "Now in Android" number 13.
All of the links are in there.
So if you like what you hear in the video, go to the article.
Check it out.
Click on the link.
All right, next up, dynamic feature modules,
so this is a really powerful feature.
If you want to decrease the size of the initial download
and install, make it easier and faster
for users to actually get your applications,
wouldn't it be nice if you could put things in optional modules
so that they didn't have to come down on first install?
Instead, they can come down later when and if they're
actually needed.
So all of that's great.
But testing those was a little bit tricky.
You actually needed to upload a bundle to the Play Store
in order to test the flow.
So Wojtek Kalicinski has worked on with the Play Core team
and on a new version of the Play Core library
to make that a lot easier.
There's an article about that that he wrote.
You'll need 1.6.5 of the Play Core library.
I think that's currently in alpha.
And there's also new documentation
that talks about this stuff to make it easier
for you to do the testing that you need to do
with dynamic feature modules.
Next up, material motion, so the Material Design team
has posted a new guide for dealing with motion
with material.
So animation is really powerful.
In particular, it's really good at helping
users understand transitions between potentially
complicated UIs.
If you can actually bring the user
from one state to the other, then they
can go on that journey with you instead
of trying to figure out where they are now
and how they got there.
So that's the good part.
The bad part is it can be really complicated
to implement these things, lots of APIs, lots of libraries,
lots of approaches for doing these things and guides
from the material team.
But somehow it wasn't obvious how you
could do some of this stuff.
So they've come out with a new guide
that's more specific about doing things
like activity transitions.
Not only that, but they've also enhanced
the material components library with transitions capabilities.
So you can actually start from their library
from their APIs and these built-in capabilities
to build in those transitions into your own application.
So check out the new documentation, the guide,
and the article and certainly the library for that.
There's been a few articles posted
that are worth checking out for developers.
Nick Butcher had a couple of articles posted.
He has an ongoing series called Android Styling
where he's talking about themes and attributes and styles
and how they differ and how they're the same
and how you should use them.
So he's got two articles there this last time,
Common Theme Attributes-- it's how you should use these theme
attributes for things like colors, common things
that you're doing instead of hard coding that information.
And then the next one is called Prefer Theme Attributes--
again, sort of harping on that same theme of using attributes
for common things like colors in your app
instead of using resource references.
So they provide a lot more flexibility as well as
semantic clarification for your application in your code.
And then also, Shaun McQuillan posted
an article on view binding.
So I mentioned this earlier for the 3.6 release.
Now you can use view binding instead of find view by ID.
And in fact, we kind of recommend it.
You should use this.
It really cleans up your code and is a better approach
than some of the other approaches out there.
So now you can use it in the full release of that tool.
And now with Sean's article, you can find out
how you actually do this, how it works,
and how you can integrate it into your application.
Biometric prompts, there's a new article
from Isai Damier which talks about how biometrics
relates to cryptography.
They are not the same thing, but they can work together
to make sure that they protect your data in a very secure way.
So there's an article that he wrote, and then there's
the sample links from that article
as well that you can check out.
Speaking of biometrics, Isai also wrote a new sample
for biometric login.
So if you are trying to figure out
how to integrate biometrics and biometric login
into your application, be sure to check that out.
And then finally, we have some new videos out there.
Nick Butcher posted a long-ish video on vector assets.
So we, as a developer relations team and engineers
here, we'll go out and we'll give these conference talks
and write these slides, sort of encapsulate our thoughts
about how things work into a presentation,
give that presentation at a conference.
Hopefully it's recorded, and then hopefully it's posted.
But there's sort of this diminishing returns of like,
well, how big was the audience that saw
it, that saw the video posted?
And we thought for some of the more important things
that we do, why don't we actually re-record
those in an optimized way in the studio
and then post that and share it on the channel to make sure
that all the information gets out there to all the developers
that want it?
So the first one of these that we're doing
is this talk that Nick Butcher did recently on vector assets.
It's about using vector format instead of the more traditional
PNG format for images.
That way you can get these re-sizable sharp images,
and you can also have powerful ways of animating those images
over time using things like vector drawable and animated
vector drawable.
So this talk covers the technical details of that.
And then there's also a video from Florina Muntenescu
where she talks about sealed classes,
a nice language feature from Kotlin.
It has capabilities that are similar to enums
but builds in a lot more flexibility
than enums give you.
So you only want a standard and constrained set of values,
but you want more capabilities from subclassing, from--
just more flexibility in general than the data structure
format that enums allow you.
So that's it for this time.
We'll be back next time.
And in the meantime, if you liked what you heard,
go ahead and share and like the video.
And please subscribe to the Android Developers channel
on YouTube, thanks.
[MUSIC PLAYING]