#116 — BlrDroid Android 11 Meetup

Похожие видео


What's new in Android 11 - Chet Haase and Romain Guy. Fireside Chat with Chet Haase, Romain Guy, Yigit Boyar and Murat Yener. Adapting Your Apps for Android 11 Privacy Changes - Joe Birch.

Текстовая версия

Hello everyone welcome to a third online Meetup this is a very special meter for us we have people from Google's Android team joining us and we?

Have sessions around Android 11 as well as a live Q&A sessions for everyone? To answer their questions so we also had chat and romain to this stream. And they're going to talk about what's new in Android 1101 requests for.

You if you have any questions regarding? Android 11 or Android in general please. Start putting them in YouTube comments so that we can have them answered in the Q&A section which will be followed by this session so yeah just let me:

Exact hi-tech hi yeah please introduce Oh how about if I introduce me I'm better in introducing! Me anyone else hi I'm Chet I'm Chet Haase from the Android developer relations team!

Thanks for coming to the event and thanks for having us here yeah Thank You Jay hi Roman hi I'm all not from.

The Android toolkit team thanks for having us it's really weird it feels like this are we sure there are people watching this. Yeah so basically just talking to chance really good so we'll get started with your session let me just read? Your slides okay I'm gonna remove myself!

From stream and then over to you guys all right so welcome to what's new in Android I think we already: Introduced ourselves so we can probably just.

Go to the next slide first of all I did want to point out that the last time I gave a talk in Bangalore it? Took me like 97 days to get there and. I was incredibly jet-lagged and so now we're doing this late in the evening our time so that I feel exactly.

The same completely out of time here so I've always wanted to go to India I guess. I finally did yes there's no good took not quite as long to get there this time so the question?

Is what is new first of all what's! New about this normally we give this talk once a year at Google i/o it's usually okoma it's usually me and it's usually. Dan Sandler who is not going to join us tonight because it's even later in Cambridge where he lives I I didn't.

Actually it was it was a secret don't tell him but otherwise. The talk is essentially the same as it has been since what 2011 the first. Time we gave a talk like this which means we are going to talk about?

The platform we're going to talk about the larger changes that happened. In Android 11 are still happening in Android 11 since we're now in the beta period of that release.

We'll also talk a little bit about Android studio and see what's happening. In the tool space and we'll also talk about some of the unbundled.

Libraries and api's that we offer outside of the platform so yeah what you think about this talki. It's the talk where Chetan will not try to explain things they do not understand no no you're not supposed to give that secret. Away no no we we know all the stuff cold absolutely I wrote these slides I must know it right let's start with.

UI my favorite area probably your favorite area as well MoMA and and everybody else is as well so first of all let's talk about. Window in sets this is a very old API that has a lot of functionality that.

Didn't really make sense it was difficult to deal with it gives you information about the in sets that are available. The constraints that are on the screen but it does not give you the information you actually want to know which!

Is what is the window that has those in sets and by gosh where? Is that ime keyboard anyway so we have changed the API quite! Substantially in Android 11 we've deprecated almost all of the old methods that were there all the ones that didn't.

Really tell you all the information that you wanted and instead we introduced a lot of new API to this class that does give you? That information so now you can ask for in sets information that is specific to the windows on the screen that you really.

Care about so things like where is the status bar and how big is the navigation bar and where is that. IME after all so the way that it works here's a little bit of sample code you set this window in sets listener inside. That you can get the window insights object and then you can actually see.

If the IME keyboard is visible who knew that this was so difficult that's right everybody. Did you took us only 12 years to do to point at the CP I this is this is like:

Two new methods so far so yeah it took a while yeah people. Have been asking for this kind of functionality for a while and and now it's here so also you can once you. Know that the keyboard is visible you can actually get information about the insights.

You can find out where it is and how big it is so the question. Is why did we do this now in sets has been there for a while well the answer. Is at least partially to enable IME animations my personal favorite feature in the:

Release so finally you can synchronize the content in your application with the motion.

Of the keyboard so previously the keyboard would animate. In it was a nice smooth animation.

But you couldn't smoothly animate your content because you didn't know when the keyboard was coming you would just get a message. That told you the new size that everything was and then you had to react to it so your. Application is snapping while the keyboard is animating and not a great.

User experience so now you can actually synchronize you can get information about the keyboard and you can even control that keyboard. Animation so let's look at a little bit of a sample so these? Illustrations come from a sample I'll put up a URL later Chris Bane's we're at the sample to show how to do some of the stuff there's two.

Versions of the control of the keyboard going on here? The one on the left the keyboard.

Is doing sort of the default motion which is it is snapping. Into place it is animating in so you know you tap on the edit text and it automatically.

Animates in at whatever it's normal animation rate is and the application. Can get that information and animate its content.

Appropriately so it is reacting to the keyboard changes and changing.

Itself to synchronize with the motion of the keyboard on the right. It's even more interesting the the user is actually dragging the information dragging? The content in the application and then the application is controlling frame by frame the animation.

Of the keyboard itself because it has full control over this so we'll take a look at a little. Bit of sample code to show how that works so this is the animation that was on the left there the keyboard automatically animates in and the application.

Listens in to see what's going on so you set a listener this callback object there and then you can basically listen to the motion.

Lifecycle to figure out where that keyboard. Is and what you can do about it in your application content on the other side on the right-hand?

Side of that sample we saw the.

User driving it with its gesture as they are scrolling the content the keyboard smoothly. Scrolls in so you can set up an animation.

You can drive it to be set and forget! But in this case we actually wanted to drive it to be gesture driven reacting to the user input. Instead so we say well we're animating the keyboard here.

It's going to be infinite duration we don't know how long the animation is going to run because we're just driving it as the user is pulling? The content up and down letting our interpolation for the same reason where's it going to be going frame by frame anyway. You can have a cancellation signal in case you need to kill it in the middle and then you can find.

Out about lifecycle events of the animation so go ahead and check out Chris Bane's. Is sample code for more information so you can start creating these experiences in your application still: In the UI area we have this whole area that we call people which is about surfacing.

Content about the people that are important in your life as a user of one of these devices it's clear. That this is most of the stuff that that people do on their devices is interact with friends and family and? Colleagues and the ability to get back to those conversations quickly is kind of important so if you were in a chat application and then.

You're using something else let's say you're an email and then you want to get back to that you get a notification? From them and then you have to go through several clicks maybe go through the home screen.

You run this application again deep deep deep and then finally you're in the conversation wouldn't it be nice instead if you could. Just automatically get back to that conversation and that's what you can do now with the new conversations capability so here!

We see a sample notification we have a new area of notifications in the notification panel called conversations. And these are the pieces of information that were propagated.

From messaging applications for the people that this user wants to interact with you: Can long press on one of these items and that will bring up.

A Settings panel where they can set more information how do I want to notified with you no vibration motor: Or ringtone or whatever when this particular person contacts.

Me so you can specialize that you can also set the priority so you can say actually this conversation. Is the most important one it is about you know the education: The schools and my kids are in or whatever so please put that one at the top of the list.

So you can change the priority and then that actually changes the ordering within the notification! Panel according again to the people right it's all about the people so the way that you. Do this is you create this person!

Objects person is not a new API I think you came out in Android.

10 and create this information and then create a shortcut a long-lived shortcut that you will then populate. A notification with so you push the shortcuts and then you use messaging style here's an important requirement you have to use messaging style. Now maybe you already are this is also not a new API but it is a requirement of the conversations.

Approach and then you build a notification with the shortcut ID that. You created earlier up above for the long-lived shortcut alright. So once you have that information you're already in the notification panel you're.

Already in this conversations area you can also propagate it to an area that takes place all over the UI the new capabilities. Bubbles so bubbles actually existed in Android 10 already but as a developer options so that application developers.

Like you could start playing with it but it was not!

Actually propagated to users yet because it wasn't quite ready well now it is it is there it's full fledged feature. You can use it and propagate this information into bubbles and then the user needs to opt in so the first time?

You ask them to have a bubble in their UI then they need to agree to that experience. So you're not just popping bubbles all over the place where? Maybe the user doesn't want them here.

We see a sample that was written by yuuichi on the team you can see a bubble there on the upper left and when you tap that. Bubble then you get this a little. Mini activity in place right it's Institute's right there so what do you do to actually create that.

Experience first of all here's a little bit more information oh I should point out that! This is basically a replacement for what most people were using system alert window for system aware window is a really heavy. Hammer for doing kind of stuff it populates:

The UI with a transparent window that rides over everything and then they put this little piece of information in there I'm thinking. Like Facebook the messenger chat heads I believe use this and and other similar. Approaches elsewhere because it was really the only way to populate a UI that rode on top!

Of everything all over the place well instead use the bubbles API stop using system alert window because. This is really a better approach another tween the API could be abused? By application so this is you know because.

There was a good use case for this API we are making it harder to use the: The abusive API and now instead you have this yes exactly so how do you create these bubbles you're going.

To use the notification API which you're probably. Doing already you just need to add a little bit more information about it so there's a little bit of metadata about the bubbles information that.

You need to propagate and then there's information about this little mini activity that's going to pop up when they actually. Tap on the bubble so first of all you say okay I've got this new activity here and it needs to be resizable!

Because you'll notice in the sample that we saw earlier it was a smaller: Activity it actually popped up on top of that the that UI exactly in place when. They were on the homescreen right so needs to be resizable and then you need to create.

The intent for that activity you have this shortcut info that you're probably already!

Creating already especially if you're doing the conversation stuff and then you create the bubble metadata and create a notification populate.

That with the bubble metadata and you're good to go more information. About this is in one of the talks that came out with the launch is called what's new in system UI there's. Also more information more content that was published this week this is the first.

Week of 11 weeks in Android and the first week was all about people so there's more content on all of this stuff there's. The sample that we saw the screenshot from that's on github.

Called bubbles caught one so check that out and also we recorded a a DB podcast with engineers on the bubbles?

Team a few weeks ago and that's posted a couple weeks ago episode 140 called. Bubbles so I would like to talk about privacy: But I really don't think I should and in fact I really don't.

Think I will because is someone else is going to there's. A talk right after this from Joe birch so momma and I are gonna give this talk and they were gonna do a Q&A and then Joe birch. Is going to give a talk that is adapting your apps for Android?

11 privacy changes and he's going to go way more. In depth than I was about to so I'm not going to talk about this stuff at all so stay tuned. Listen to Joe it's what I was saying earlier like it's good that they sent someone who knows what they're talking.

About for this culture talk because it's very important so I'm glad that someone else. Is doing yes all right so one of the other things that we focused on in this release all releases. But there really were quite a few things in Android 11 was stuff for developers specifically for making.

Your development lights easier one of my favorites of course is Wi-Fi debugging because frankly there are never enough.

USB ports I took this picture it's basically.

Of my desks is sitting in front of me right now and it looks even worse now there's one dongle there!

With three cables plugged into it because I didn't have enough USB ports and now I actually have two daisy chain dongles because?

I had yet another USB device to plug in and again there were not enough USB ports? So we created the capability to talk to your devices.

Over Wi-Fi instead so very cool you don't necessarily. Need that USB port to plug into it it is a little. Bit of a manual process right now you need to enable it through.

The UI and there's also command-line options to actually set this thing up a pair and connect with the device. However the good news is I think it's Android 4.2 the canary that just came out has a capability so early version of playing with.

It within Android studio which is always the long term goal it's just not quite there. Yet so if you want to play with it in studio get 4.2 otherwise you can use this. On whatever Android studio release you are currently using another way we made things easier was by adding.

Even more annotations in the platform api's we've been doing this in previous releases in a couple of different ways so in each release:

When we add a new annotation it's one of these recently.

Annotations recently nillable or recently non-null and what that means. Is we just added this annotation we don't want to break your build but we do want to tell you that you're doing something wrong.


So when you are calling code that is not obeying the contract that. Is in these annotations then we will give? You a warning in your build on the other hand if we already had a recently annotation.

In there maybe we've upgraded into this release. To be either nillable or non-null and now when you. Call that code with other code that doesn't obey the contract we will break.

Your build that will break right there because you know what it's way better?

To break the build than to break: The runtime so please catch it at development time and we are hopefully.

Helping you to do that another way that we're helping is through crash reasons. Reporting one of the hardest things to do in debugging and fixing your problems is finding out. Why they crashed in the real world right we all have a set of devices emulators and!

And hardware devices that we use and we have you know this host device and we have apps installed we we try to mimic a real environment but there?

Is no way that you can mimic.

The real environment everywhere in the universe. Of all these different kinds of device setups and people with different apps installed in different memory? Configurations and so what we've done is we've made it easier for you to detect:

What actually happened in the fields so there's! An API to find out what happened to your application and then. You can upload that to your server.

And take a look at it and see what is going on so you can get historical process.

Exit reasons and then walk through those reasons collection information that we give you and find out. Did I run out of memory was there an actual crash was there an ANR now maybe you:

Would do this you you certainly could do this manually in your application. Maybe you already use a crash service like crashlytics or whatever and that's totally fine these craft services may also take advantage? Of an API like this under the hood eventually for example I believe.

The information on ANR's is really hard to get they kind of need to connect the dots but this gives them much more tangible information about. That so hopefully good both for developers as well as for library developers that that. You may be using more indirectly to get this information GWP a SAN is an advancement on something.

That we offered in Android 10 called Hwan Hwan was about using a different memory allocator basically. To to put an overhead layer an extra layer on top of memory allocation so that if you: Try to access memory incorrectly let's see a free an object then you try to access that.

Memory we will detect it because there's that extra layer of error checking. Going on which is great at development time but it adds both a lot of memory because now you're adding like all these other?

Methods all over the place for allocations in this in the heap the negative? Heap it also adds runtime overhead because!

There's this extra step to go through every time you allocate and free and so we've taken a different: Approach ewp a sin and you can use it in the real world so instead of being laid over every memory. Access it's it's sampled instead you can think of it as sort of the memory allocator equivalent of the sampling profiler!

It doesn't measure everything it just measures a few things here and there and if you happen to trip over one of those then you're going. To get really information about what you were doing and why in the real world. And it's so low overhead I think the size of the library is about 60 K and the runtime.

Overhead is negligible so you can feel free to bundle this with your application! And ship it out there so I should point out that this is for native Delaware. Developers so if you're using Android SDK at the java api Kotlin api level.

Not for you but if you are doing.

Native development like game development probably worth looking into and then also the cool thing about.

This is the reports are automatically uploaded to the play dashboard so what happens. Is when you actually access one of these things incorrectly it will automatically crash. Which it may have done anyway and then it's going to log a nice report for you and that'll go in your dashboard so to enable.

This you just add this into your manifest GW PA San mode equals always and then when you crash you're going to get a error: Report that looks a lot like this maybe with a larger font size a DB incremental is about being able to install.

Your application faster which we'd all like to do but if your application. Is huge we'd really like to do that right so you can use command line operations. And if you have a really huge apk it can save you up to like ten times in install time so imagine if you.

Have like a game with really huge assets it's two gigs and you've got to push this thing you've got. To fix one line of code and then push two gigs of data down to the device?

Can take a while right but now you can get much faster pushes and you can get even faster than. That if you just want the the code that. Is that you need to be playable so check.

That out yeah and if you want. To further improve your ADB push Fabiana song la had a really interesting talk at the Android dev summit.

Last year it was a short talk.

On USB cables turns out that not all. USB cables are as good as one another.

So it's only five minutes recommend watching it so you can find a better table it helps does?

It also help if you like should you have your device like downstream of your laptop.

Does gravity matter oh yeah okay all right like I thought that's how it worked yeah. So the way it works is you need to sign your.

Apk with this new approach and then do an install - - incremental and away you go and it only installs: What it needs to there are usually behavior changes in every release especially as we make privacy changes and we lock down the information.

That applications can access so that we can protect user data and make it more transparent to users but we're taking. A couple of approaches in this release?

That should make it easier for everybody to adopt these changes for one thing most of the changes that we're.

Talking about in privacy or that Joe birch is about: To talk about in privacy are only going to take place when you target this API level.

So you will target it eventually this. Or later but for now if you.

Are not doing that yet in this release then for the most part the behavior changes?

Will not affect you also you have the ability to toggle these behavior changes one by one to see.

How they affect you so you can test this much. Easier at Build time you could already do this for various things through the command line but the new cool thing that we've enabled!

This time is there's a new UI for doing that so we can see that UI here? If you go into developer options you can. See all the toggles you can access directly or you can continue using.

The command line so here if you do the the disabled command here then you could see the UI let's do that again what's. That you are wow that's amazing all right so you command line or you use the UI we're just trying. To make it easier to adopt these changes going forward all right so now we're going to talk about the real interesting stuff.

The only interesting stuff graphics in media so Chad is driving the slide! So Chad I'm just gonna say what I have to say you'll.

Figure out when to advance okay like that yeah yeah I first stop indicate! Image decoders so on the platform we have a number of image!

Decoders you know for gif files PNG web P jpg and so on tradition. When you access those through the image the color API or bitmapfactory the point.

Is that when you're writing native code decoding an image in the real awkward because your own age code. You have to up call through j'ni to the job a later make your. Code there but the Java layer will go back to Jane I because our image decoders on the platform.

And written narrative so there's a lot of overhead for absolutely no reason so a lot of apps are bundling their. Own decoding libraries and a lot of games do that which increase the size of your apk so the good news now. Is that we have NDK API is for image decoders so there's a bit of code!

To show you how easy it is to use first of all you point to an asset with an asset. Descriptor you get back an image decoder. Then from that on that decoder you can set the format of the bitmap that you want for instance if you need:

A high precision you can use the format RGB F float16 instead of the ad debates. That we use traditional and finally you just need to allocate your buffer! For to host a bitmap which means it's also a extremely trivial to reuse chunks of memory when you in native?

Code when you decode multi point matches in a row for instance and family you just call the decoder and boom: You have this beautiful image in the top right I don't I'm not sure what it is it looks like! A big nose it's a it's a teapot it's a standard graphics 3d object right all right.

We've also added support for animated Heath files so he for gif is a more efficient compression.

Format it's kind of like a super JPEG if you want like higher! Quality smaller size definitely better than gif or Jif a very pronounced it so now you can and give the he format support enemy:

Eight files or second gif as opposed to PNG for instance and we can load this animated he files.

Through the animated image drawable API just like animated gif and let me show you actually some code so you understand how. It works so you go into image decoder so image. Decoder is our new API it's kind of like the successor:

To bitmap factory it's much better it's only pet that. Makes a lot more sense so you create a source from from us decoder pointing.

To a file and then looking at the drawable that you decode you can. Check the type of the drywall and if it is an animated image.

Sharable you can call the stuff method to start playing the animation. And for those of you we need to use down. From NDK we had the CPI a called opensl es su vida stands for open sound library.

Just like OpenGL it's now deprecated instead. We have a library called oboe it's an unbundled C++ library and it was designed from the ground up from the ground up for high performance audio. And low latency so it's very important if you're building.

For instance a synthesizer or if you want to you know to Evan and the generates. Music on the fly it works all the way. Back to API 16 and it's open source you can find it on github so you don't.

Even need to wait 411 to deprecate open it cell you can already adopt mobile. And I believe actually that's dynamic slide we had an episode on precisely that of our Android developers backstage episode 135 so if you. Want to know more about that library please listen to that episode then we have support for viable refresh rates.

So since the early days the vendor in all the panel all the displays on phones run at about 60 Hertz more or less and that.

Means that for for applications that run their own render loop let's say you have a game or you have.

You know a heavy media application you cannot drive the screen yourself. The point is that sometimes you're doing just a little too much work and you can't hit the frame rate of 60 frames.

Or second and the points that because on Android we don't let you do tearing the only you will fall back to 30 frames per second. And get sputtering bad when your applications on the cusp of being able to do 60 frames per second so that means that your application. Will go back and forth between 60 and 30 in cerulean pleasant experience for the user so now we have a number of devices the:

Phones in the case of four that supports that support better for me it lacked many Hertz or 120 Hertz and on desktop and laptops now those. Those refresh refresh rates go all the way to 300 so I assume this will come through phones.

At some point in the near future what's very interesting. With some of those panels not all of them is that for some of them the system can dictate the refresh.

Rate so will not log to 60 or 90 or 120 the application can tell the system! For instance with surface that same frame rate what is the frame rate you'd like to have.

So let's say that you can only! Hit 45 45 frames per second you can tell the system the system look at all the windows. On screen and will decide based on the different information from all the applications what the frame rate of the display should?

Be so chances are if you build a full full screen application like a game you're.

Going to be the only one visible and you're going to get the frame rate you want:

On devices that principle is kind of this kind of features and he gets thermo api's so this is an API we had available in the. Java layer I think study in Android 10 online maybe one of the two and they can be important because not all the workers. Are aware that when you use the device heavily like when.

You run a lot of computations or if you turn on a lot of the the computing blocks of the device. Using functions GPU the screen the sensors the camera at the same time kids build up and to avoid Prime's.

That go from melting they are built-in protections in the system so when the when the heat reaches a certain limit.

The device goes into thermal throttling so it starts lowering the clocks of the different? Computing block so he lowers the performance of your application and the point is that there was no way for you to know that: And can be really useful in the game for instance the window device!

Is about to get into that state maybe you can lower the resolution or start drawing the fancy effect.

So we can maintain your frame rate even even though you aren't under a thermal throttling of course sometimes you know thermal.

Throttling can be much heavier than that for! Instance the other day I left my phone outside it was 95 degrees. Fahrenheit in California I went back to it and it was off telling me that it was too hot.

So I had to put it in the freezer. For few minutes to be able to use it right away anyway here's I learned this from my wife recently.

That the a lot of the dashboard mounts for a phone sit on the dashboard sit on the dashboard. Not just like in it but on the dashboard. And what do you use with your phone what do you do with your phone!

In your car you navigate right so you've got the screen on you're running a really expensive application that takes. A lot of processing power and it's sitting in the Sun the entire:

Time the hot California Sun bad bad combination anyway so now we have api's engine I so you register. A listener you will get the status some.

Of them are pretty scary if you receive their shutdown or emergency status you really need to stop what you're.


Doing something that's going to happen the critical status is a little more interesting. That means we are about to lower the performance of the device and you can do something. About it so as you can see on screen.

Super simple like in a couple lines of code you get the thermal manager you register the listener. And when you're done you can under history your listener and release the manager angle is a kind.

Of layer for OpenGL yes that news by Chrome for a long long time constants used?

On Chrome by Chrome on Windows to run OpenGL ES on top of DirectX that chrome only needs targeted single graphics. API so now it's available on Android we've been working on making OpenGL ES to run on top. Of Vulcan so the idea here is that there would be only one OpenGL?

ES implementation that we provide as part of the system which should help reduce the number of bugs or differences between the different devices? Different drivers it is not quite ready for production yet but in the directors studies you can turn it on if you want or the non-core application. So if you have an application that using OpenGL you can turn on angle to see how your application will behave you might run!

Into bugs which album you might see! A huge drop in performance please also tell us that it's happening because it should not be happening. All right so that's for graphics and media but there:

Are some other interesting ideas as part of the platform the first one is nn API that's. Neural networks and SE C API to be able to!

Execute neural nets so there's a number? Of new features available if for instance if and well?

You can now do branches in loops owner networks there: Is one new feature I have no idea what it does but it's called heart's wish at first I thought.

It was a bad basketball like you. Know he goes from the score hearts? Wish but it's not it's but neural networks and I'm sure that you know if you do machine learning and neural nets you miss.

Very excited by these new up codes there's. Also more control over how the the execution of your neural! Net takes place in particular you have fence compute so you can better order a chain of dependencies:

Without involving the CPU and the new memory domains lets you avoid unnecessary.

Copies between that cell you see the GPU an NP you or the CPU so you have better. Control of where data lives 5:3 so this is coming to you know a lot of the networks.

Out there so if FG gives you lower latency network and much much more bandwidth so you can be very interesting for applications. To be aware of the state of the network because the tech before they take advantage of those. New features followed by 5g in particular you want to know if you're going?

To cost the user a lot of money because if they pay by the gigabyte let's say.

And you start using all the bandwidth and 5g you're gonna cost the user. A lot of money you can also check the actual speed of the.

Of the network link so you can see an example on screen you can check if the if the network. Is mirrored or you can ask for the actual.

Bandwidth of the network before you do something replication then we have a new feature the biometric.

Authenticator strengths so different devices have different biometric identification systems there's 2d face unlock the 3d face unlock. There's fingerprints I think there's ice canners and I'm sure there will be more things later on so now there's a way and those. Different devices different ways of an authenticating don't have the same level of security:

For instance a 2d face unlock is easier to fool than. The 3d face unlock that make sure that you know it's an actual. Activity face and blink and so on so now.

What you can do when your code when you get a reference to the biometric manager you can specify?

The strength of the authentication that your app requires so then you can. Ask the manager whether or not the device can support this kind of authentication if it does then you can craft. Your intent and in the intent we can specify.

The strengths that you want so for instance you could imagine a banking application requiring some level of security before you. Can access you know your money and if you want a device that does. Not support the the strength that you seek then you can either.

Ask the user to go turn on the feature in their. Settings or just you know login in a different. Way or whatever else you want to do in the application autofill and.

Keep on integration that one is an interesting one so when you are when you have a different input field. In your application we have this photo field service to automatically enter your address or credit card your login and password. For instance so you have suggestions that are contextual but you also have a keyboard and the keyboard:

Has its own contextual suggestions you know do to complete so windy nice.

Both types of suggestions showed up in the same place so this? Is what we did with this integration so there are two parts to this there's new api's for the keyboards themselves. So they can receive the suggestions that they should display from the auto-filled providers and you know most of the time those autofill providers?

Are password managers you know like less pass or one password and so on and of course.

This needs to be secure so what's interesting in this implementation. Is that the autofill system does not send the actual data to the keyboard he sends Duy to present in a sexual fashion! So the keyboard does not have access to the security of your data you can see examples on-screen here for instance!

Here when you're sending in your suggestions at the top of the keyboard for your email and password.

You can have questions on your credit card or for a street address if that's. What the app requires each meant John so the way it works. Is pretty simple like I said they have two sides.

To it if you're writing an ami keyboard the autofill system will call on create: In line suggestion or request telling you that the the the autofill?

Wants to provide suggestions so you return. A request and in that request we can you can tell the system ok what your Cal's your support and how many. Suggestions you can present user then when you're done you will receive the on in line suggest suggestions!

Response and that is the UI that you need to display on the other side if your password manager you have this on file request. Method that you implement in that method you craft a data set and let the less that you can create in line presentations: And those are UI bits that will appear.

Inside the keyboard and when you're done creating the data set we get you just create. A response and be sent to the aim so that was it for the platform! But of course you must you must be used to it by now we have a lot of other things that.

We ship outside of the platform the?

First one is jetpack so now we have actually chat I think you're slightly.

Dated we have more than 80 libraries I think it's something like 150 artifacts and we really stand very often actually we have a release train.

Every two weeks so not all libraries ship every two weeks but every two weeks we do ship something? It's a lot of libraries and recently.

Actually last week we've had a series of new libraries so the first one is held it's a new dependency. Injection API built for Android on top of dagger so it extends dagger and entails features that are!

Specific to Android to make it easier for you to use dagger and this is now the solution that we recommend.

As the Android team for dependency injection. On Android of course if you have something else that.

You use and like you're free to keep using it but if you don't know what you should choose or if you're.

Writing a new app you should take a look at health.

Paging 3 it's a new version of our paging library it's now written entirely in Kirkland. It's our first library rewritten from the ground up in cutting. And it has two parts origins app startup so a lot of libraries to hook into the life cycle of the application or register.

Content colliders the problem is that every content provider that you register in the system.

Slow is there on the startup of your application value a little bit I don't remember the exact numbers which we're talking.

About you know 10 20 milliseconds something like that and every content.

Provider that you register for that purpose is slowing down your the startup of your application so now instead we have this library and it itself creates one! Content provider but then it exposes an API so that you can participate in the life cycle without having!

To create yet another content provider it's a pretty small library so I encourage you to take. A look at it in family camera X as rich data status so camera X is our new camera API that works across? Multiple versions of Android it provides features that are specific to different devices that's the concept of extension constants on the device.

That has HDR may have access to it via the camera X API and makes things a lot simpler: In general we also have jetpack compose so you've probably heard of it but jetpack compose. Is a new UI toolkit that we're working on it's written internal in Kirkland!

It's based on the reactive programming model and it's quite different from what you are used to in jetpack Campos. Every widget is just a function it's a very interesting model it's super easy to use and you know I've been using. The Android UI toolkit for the past 12 13 years now I wrote:

A good chunk of it and now the hard time using it another the music the controls.

It's it's a lot nicer I think it's not currently in alpha yet our plans. To release an alpha later this summer. But it is developed entirely in the open:

So if you look at the AOSP repository you can see everything that's. Going on and just like with jetpack we release: A new Developer Preview every two weeks so we're currently at Death Star team it's the jetpack compose Developer Preview - that's.

Our marketing intern and there's going to be death 14 I believe. Next week I think - there is a what sample and tutorial the jet news yes we're sampling tutorials on github if you.

Go to developer that Android comes - jetpacks - Campos you will have links to a code lab the tutorials we also.

Did last week as part of the Android 11 beta launch there was a I did a video where I show. Some of the new features it show to see what it looks like alright so good well it good place the good start!

Android studio we have three major releases for you first of all 4.0 is now stable. It comes with a motion editor for motion nails so motion out is a way to create really complex animations as part:

Of your usual but you know until now you are doing it in code. And with motion editor you have a visual.

Tool to do that and if there's one place where visual tools are extremely! Helpful it's for animations you can visualize all the states of your animation.

You can scrub back and forth in the timeline you can admit properties you have you have keyframes it's a really really. Powerful tool we also have the layout inspector it's a it's a replacement for hierarchy viewer better integrated.

Android studio you can see all the layers? In your application with the 3d view it also works in semi real-time so whenever.

You make changes inside the application let's say you navigate to a different:

Screen each refresh is almost right away and my favorite feature. Is that it tells you let's say you have a text view and the:

Font size is 40 very often you might have to spend quite a bit of time figuring out what style that forty number is coming from. So the layouts inspector does that for you all you do is click on the value and takes you to the XML file.

That the value came from we have 4.1 Android.

Co 4.1 beta one of the big new features is the database. Inspector so if you're using sequel Lite or room while your application is running. You can connect the database inspector and you can see everything that's happening?

In the database in real time and it's really powerful because you can also make changes to database. So if you make a change to the database and you. Use room yo you are your UI will react in real time as well so it goes:

Both ways again if you look at the videos that you watch the videos that we published last week!

I gave a demo of the database inspector!

Used in combination with with controls and family 4.2 canary so it has the wireless. Debugging feature that Chad mentioned and you want to use jetpack controls until we hit. Alpha of a list you have to use the latest canary so until now you had to use 4.1 canary!

And now you have to use 4.2 canary so we'll stay in the canary branch we've also done: Things that are outside of Android 11 we have a new Android game SDK it provides. Native libraries from game developers for instance from pacing we talked about framerate and it's important to be able to produce frames.

As fast as possible but it's a growing point to present: The frames at the right time and this is something that can be very hard to get right? So the graphics team built that frame pacing library to do that for you trust me a colleague.

And I had recreated the this library ourselves now in a rendering engine you do not want to do that please use the. Library play as a delivery delivery to distribute large game assets we have better profilers in Android studio so we have a native memory.

Profiler we have a better integration with systrace and you you can also access some of our previews for other development tools for instance?

We have an extension for visual studio we're working on the GPU inspector and will.

Let you do some some type of profiling for the. GPU which until now required tools that were specific to the GPU that's on your device and that were difficult to use across multiple.

Devices so check out that Android that comes such games if you want to know more so that's! I was about to say that's no that's not quite it there's one thing Google Play so when you publish.

Your app you have a new play console and so complete redesign of the UI much easier to use much nicer nicer visuals? You have a new section for the policy status a new section. To check the acquisition reports to know how you're acquiring your users and also to manage your team.

So who has access to the console and who can publish on that so it's currently. In beta if you want access please check out play that Google that comes hash console to know more so that's. Really it if you want to know more we have a bunch of launch videos that I'll just mention you.

Can see the URL on screen if you want to check them out so we talked about design tool system UI privacy!


Storage access curtain and so on we also kick-started this week the 11 weeks of Android: So for the next 10 weeks every weeks we're going to have a new theme so we just had people and identity?

It was about conversations and bubbles make sweets about machine learning. And you can see the full schedule on on the slide and we're going to have videos?

Samples tutorials every week so you'll probably be tired of seeing chat! Very soon because I believe is gonna end see a lot of it and of course. We have android 11 meetups all over the world you're I believe you attend we're doing one of them right yes yes all right?

All make sense it's very recursive reference yep so you put it on you to attend another one but if you have friends. In other countries would let them know they might be interested and of course.

Chet had to plug in his head you yeah dude you need to find better. URLs do that I'm working on it there should be a single! URL every couple of weeks chatez this segment called now in the Android it's basically a summary of everything that's!

Going on in the world of Android because of what is happening it's actually pretty hard. To enforce to like stay afloat so and because. Chet loves attention he publishes articles videos with the same content and a podcast with the same.

Content so if you want to hear the same thing.

Three times you can and that's it for us and I think we're gonna. Move on to a Q&A first we're gonna pause awkwardly while they yeah we're gonna pose awkwardly. Now so we're gonna take a two minute break right now and then we are going.

To return with five side check so yeah I'm gonna remove you from stream now hey everyone so we are going. To take a just a quick two minute break and then.

Give an autograph you hey everyone so start our. Fight side session where we will have more engineers from Google's Android team join us including yet bore our heat.

We are and Emirati Annette along which I turn domain: So let me just add them to stream hi eat how are you yeah I'm good how are you please?

Introduce yourself my name is Heath I work in the Android team must undo each other libraries yeah good hey Murat hey how are you good.

Good how are you yeah I'm good please give a quick introduction for our audience so I'm route. I'm a developer advocate the Android era yeah good let me I checked and Romain hey everyone again hello? Again so we have all of the engineers here so now I'm gonna go out and then I'm start presenting the questions which.

We had from our audience permanent feature Oh shall I take that one I think we answered.

This during the talk no it was it was basically pre-release in Android ten because they had some finishing. Details we talked about it on the podcast actually: I asked them why but no it is a full feature the API is stable!

And solid and we would like people to start using it I don't know if there are limits there's no idea huh this. Is a great example of a question.

That is a really good question to ask that we don't know the.

Answer to so I'm glad you asked this so that we could say that try it out and let us know how many how many cars can.

Be presented write a for loop just. Like you can in some of the new and and API implementations in android: 11 and try it out yeah I think because it's a wild yep custom format.

Of media yeah if it's not recognized as what image video or image video or audio use these torchic system work for that's right?

Yeah you need three of the system that come on speaker down yeah: It basically it is a way to enable it's a way to bring the user into the decision because you shouldn't be able to pick: Arbitrary files with your application without their knowledge right so we limit you to media?

Files from the application but you can bring the user in if if it's a file that's not recognized as though package manager so. I would recommend you watch one of the talks?

From the launch videos this is probably. I think it's in the the privacy changes talk specifically where by defaults all applications!

Have to declare the packages that they want access to there is a mechanism to declare?

That you need access to more but then there's some process. I think of manual process that you have to go through to be posted on the store to make sure that we have to vet that.

Applications are doing the right thing you you can't just say yep I want access to everything. And then it goes out there so if you're an application that does need valid access there: Is a way to do that I don't know the.

Details but watch the talk because I did see this in the last couple weeks in one of the videos.

Yep Mervin yeah land reps Jen use the query old package of sperm take a look at the google play guidelines: On ax which can use where all packages but yes launcher X: Is one of them yes this question hey do you want to try to forestall the question that:

Came up last week like wait you said it was alpha and then you said it was recommended yeah actually. All right yeah I think Chris is coming into context of how we recommend the library this is an alpha because you usually don't.

Use auto libraries now it's not like when we say here this the recommended is immediately start using it today. That being said the reason why we are so comfortable until? Compared to like many other libraries is that this is a collaboration.

With the Duggar team and they used to be exist a very similar library:

Inside Google that they use so we didn't. Create them from scratch we actually work with them to change that library to be more public consumers but just inside Google.

This why we are very comfortable with the world till we know it's killed very well like we know we keep.

Those main use cases this way we're okay to the commanded? Point right now but the library is still alpha that. Means we are going to make API changes there will be occasions but for us to be able to make.

Those iterations we need feedback so please. Still use it what you know is an upper library not necessarily you'll believe some.

Code but thank you so much if you are happy with their good and if your setup works more reason to change. It basically so there's one part storage when! While writing guild we also create and take it with the jetpack library so there's possible cases like manager and their integration you need to follow a.

Bunch of stairs to make both of the work together and now we feel there's. Just one factory we give you you give it to the work manager and forward so a: Bunch of the deviations near application would seem if people to become much simpler so if you have time to do that.

You may benefit a lot but you're set on words like there's. Doing not much reason to change something that works like I don't. Know if there's specific timing on a bit like.

York your application is considered to be actively in use when it's in the foreground and for a short period of time after! It goes into the background it's not like immediately when the window goes down the permission is removed. But it is a short time after that so I mean it we're not talking hours here it's it's just considered to sort of be in transition when?

It goes away from the foreground I think that's what they meant so if you're using you know we never. Keep on making this too crazy right.

Now actually I saw manual from the SEAL team he just tweeted something we can.

Find that I've added to the notes later on how you can scope your view models include navigation graph file using LTE injector. And time to figure out how to make.

This an API so you don't need to go through that but it's a little bit more complicated because the vision graphs company models. Don't feel it belonged there like a single fragment or a night creature so they own that is not very. Well defined so until that comes but check check out the treatment menu has implemented if you're asking.

This question outside the football field and I like if you're using dagger we have this sample of the guitar teacher component!

Sample by it will show you how to do more binding things our new model injection you can do that decided yeah brain works. Like I think they're just looking for extra. Credit they're putting as many jetpack buzzwords in as few words as possible.

Like they got dependency injection and hild and view models. And life cycle by definition and navigation all at the same time in one short.

Sentence so I think they totally they win the jetpack contest if we had one is this like a tricky question. So I start talking about the super-secret projects we have:

There are all tricky questions in the open anyway so you just have to watch your comments oh yay oh SP is like the most boring video. Live stream ever Oh Murat do you know this one I know that there is a difference in some of the behavior. Changes we have in terms of like having to target new API versions yeah actually incremental location access is already commented.

In Android q it's not a big change but in Android are we just made it required.

Instead of just being recommended so if you previously were following the best practices you should already be think that in an incremental way. But if you haven't implemented the idea you need to first ask the foreground location then give users some time before?

Ask I think the background location access do you know if this is one of the behavior changes where it doesn't affect them if they don't!

Target their release or does this affect all applications okay I know most of them were relegated to target.

SDK but I don't believe all of them and I can't remember for. A location I don't remember I know my favorite?

Feature should we all name our favorite feature in Android 11 do you have one it is another question engine! Oh but I want to interpret it as that important change that's hard maybe I would recommend!

Everyone to watch the upcoming right yeah I mean it depends it's it's really these things are comparing apples. And oranges right like the privacy changes are really huge like what the way that you treat your users and their data is hugely important and! Critical and growing and need everyday right some of the explorations that we do in you eyes can seriously impact productivity and everybody's.

Happiness with their device and their usage. Patterns over time so maybe the sums stuff in in conversations:

Will be hugely important but you know it's early days on that hard to tell IME animations are just cool I don't know anybody else. I realize because the terminal let me just use I. Can throw it food meal and I be using that feel but you see these features very?

Slowly coming into the device every week I was like wow I didn't know this was an ember. No feature I don't you always had it for a while yeah.

If I don't think I get that? What I like to keep everything is cool so like I saw a review!

Where they were just going gaga over the controlled stuff.

But I don't have like a an automated house so sort of depends on where your life is at.

How important these things are I like bubbles now there's a standard: Grade to turn off those well I mean that there is one of the.

Reason the one I we do have more privacy features.

In the US right because yeah you can save/load applications and we want to make sure that you know applications.

You know the matter where they come from respect: Your privacy so I'm not sure what can of the features are talking about that are controlled.

By the Play Store itself you know in place or we work applications that were malicious or like break.

First and if they're good applications but if the usually suppose the third! Party after then taking its toll any application is further.

Above it to find out actually I think we see my uncle very nice things about Android but if you're a regular users? You are saying but you know if you know what you're doing and you want to find out an apk I'm going to prevent.

It from people all right I think. It's fine because the user needs to make the judgment to like the same of those securities and like pick another one which. Might open a cool app store as well as not malicious one and that.

Would be only a tiny person that you're humorist and we hope that. They know what happened I know what is the new original splitter you know - uh yeah it's just something.

Happening in the framework team that allowed resources you loaded dynamically I don't. Know the details but I believe it's a platform change which means I really.

Don't think this is something that can happen how about the platform.

In general because I'm seeing I'm looking at some of the like let comments coming from YouTube it's in general we back what. What we can backboard unfortunately a lot of changes have to go in the US and the only kind of back. What we can do is just an API you could call that with either.

Of you know up on all the versions or maybe they have some kind of fall back but when you start touching talking: About resources you know yeah graphene stuff. Like that it's fairly unlikely that we came back for anything the the second question that certainly.

Some II we can pass under the team I don't know what. Their plan is for samples I I thought the appeal for this was fairly niche like not necessarily applying to most.

Developers but if there's interest in people using it more broadly we can see if there are! Plans around it yeah and it's also yeah I mean there's. A point here right like we often there's a finite number of things we can do and so we have to choose that you know.

Whatever it's we build every library we build is something. You have to maintain and your ApS that we build so if there's a lot of demand.

Maybe we can look at it and then it will scream at me for making. Him do more no I I was just talking about the sample. It's just the last part of the question oh yeah that.

Was bad so we certainly thought about this couple. Times we actually we even today in UX research a year ago so understand like how people are using. It and like what is necessary I know and I'm grateful for that enforcement finally.

After we kinda need to see more like at the time I mean did that research there wasn't really that much demand ideas solutions already. Made for people to do the right things because I mean one of the things about:

The storage is I you need to be more specific: About accessing the users device from like it won't be like it was before. Where you could eat whatever you want and from the external storage.

Amount so you have to change your application we we also consider like providing maybe a library!


That works more similar to app compat we're like it mimics the behavior in the newer versions but in the older versions. But there will be more like restricting you on the older versions to provide the new features. Whether it's oh this little big we are looking at if you have like very specific new changes you're free to reach out to me or anybody.

From low correlations but so far we don't have it right now. I could suggest a really easy version of that library. I know you like easy libraries in your team you wear just whatever they ask for you just return no it's just it's the most?

Restrictive version of storage access possible so it's it's very it's very secure what was that isn't that the what the platform. Does already there's there's an asymptote that it's approaching it's not quite there.

Yet but the library could be there immediately but yeah just just to emphasize which was saying. We we are aware of some of those.

Pain points and it's the kind of stuff that we take into account but you know it's:

Also difficult sometimes because there are changes like this. That will affect some apps heavily than others but we have to look at the entire ecosystem. And you know you have to make a lot of difficult decisions and?

So we've been talking about storage and I think we'll keep thinking about it I do not know I think the general approaches just if you're using the?

Best practice for permissions you should already be able to handle! This because they can deny you at any time right they can go into settings and they can take away the permissions that they. May have granted earlier which means your application.

Already needs to deal with the situation so I think whether it's being denied because. They flip the switch in the settings panel or whether be we took it away when you went out of the foreground?

Like honestly it's kind of academic right you just! Need to handle the situation because you cannot control what the. User is going to do I do not know yeah it's!

A long for the days where I knew with all the API is on the platform: This is just too much no so we have you I mean we hope that this will be available by desire and. If you were watching navigation and pragmatics.

We made so many major changes of the last couple of months and there in preparation to you know for one! Of the goals is payload back stack variation by toda over the span of other eight nine years we dig ourselves a very very.

Big hole in navigation and as there in fragrance there's a really long time to dig out of it to make sure it is actually?

Cancer for something like powerful by sex I want the severe course but changing pregnancy a little. Complicated because all the years people divide on the positive fragment and how you fix the bug you break their application so every.

Change we have to be super careful to make it stable. Very steel via it is coming I. Just cannot give it my frame if you move your entry.

Power brother I'm you get us reported. In fragments and then what being a glad the primers partly fiction very well on the navigation:

Side the problem is with the case in five months it's not going to be an easily: Yeah because when you change five months out of. Pittsburgh there is not what app startup.

Is for so I've started and yet correct me if I'm wrong because I know what it will be but yeah it's really? About giving libraries of way to be notified you know the application? Was starting so you can start initializing something it's not it's not what you should?

Create a splash screen or anything else? Like a good example for instance the library in re that ever edit in your application even to know the application studying so it can start! Monitoring memory so this this kind of library would use app startup to initialize?

Itself I think this is a repeat of the earlier question well for any of the automatic. Automatic decision we make in the system I assume you could find you the answer.

Or you can punish find it in the source code of a OSP but it's. The kind of stuff that we probably will tweet or might? Get tweaked so yeah also I was wrong I was I was uh mistaking this for one about the when applications went into the background no it's:

When you when an application has not been used for some. Long amount of time and I'm sure that the code is written for some specific.

Long amount of time right now but as my mom said this is just what we happen to be using right.

Now I wouldn't you know we we don't really advertise those values because they could change over time you know based. On what we learned father homework what my gosh I know this question.

Just games like we'll check this is this is the part about when the in process.

Scheduler is explained with the Linux work: Can I have to follow up with you sorry I do not know what the accept changes but the. Idea is like we used to limit.

You and now we can run all of your workers in parallel. Ization it's not necessarily better per se I could do more work in parallel they it usually helps me to throughput I have to talk with.

The work major folks to see does this mean any me like public API team but I don't. Think the changes there publicly it just changes I think this question came up in the podcast. That we did with Sameer and Raul a couple months ago I can't remember.

Which episode but I don't know three or four.

Months ago we published an episode and work manager and they talked about scheduling limits I remember the question: Came up I cannot remember the proper. Answer but you can go back and listen to that if you want to hear it from the!

Team not that I know of but also we never comment on future. Stuff easy answer well if the subtitle is not a file which. They have contributed then you need to go through system dialog to ask user choose the file someone.

Good the question was it is going to play which attack compose I know but. The team has been thinking about it quite a bit I don't remember what the current.

Status is but yeah that is something like safe state is something! That you know we want to handle but remember.

That compose is a UI toolkit right so it doesn't invalidate we're. Going to work on making sure you can clean eyes with navigation. I'd like or whatever else you know that idiot wants to do but itself like doesn't change anything about the way the marks.

So yeah was Tommy the way for you to be able to say you of state and restore your state but the way it works in compose the. State is not the widgets like you pass to state to the widget found in the application so it's really up to you there may be some trend!

Instead that we might need to save like for instance on rotation or stuff like that but overall it should. Be a lot easier than it was in the past and that's one of the main points of jetpack compose like there's only. One source of truth for state you know it's your model it's not the mall of the widgets and I should point out too that in the world.

Of jet pack compose is not called processed death it's called decomposition whether. That actually already saving Campos okay he's been already implemented: An unlivable intelligence a steak and a lot like the same?

Art auction there's no emotional just take care of it for you okay I did go ahead and check that work when everything. The API mentioned is there's nothing to hide mentioned that if I was confused the max digital! Limit so let me repeat that to arrange a question it was like in the video I mentioned will mention.

Now in ransom over cruising 400 that means that risk is immoral that is about the in process manager make a machine the. Question was like am i approaching from the next page the minute there's a limit all work measure itself in terms of how many systems scheduled:

Because the system gives a hundred inequities process it's fine each application so if you wear some libraries the postal. Schedules yeah and you use the workmen there were played you go that like speed with a hundred jobs start canceling.

The jobs of the other code you have using this Mac schedule in a gang population from Server? 2008 like don't use more than 50 count that keep yourself so it was there's no job for your own application but that is unloaded now: I think the questions are for all right and I think that was the last question.

Yeah hi so yeah we are gonna end this session now so thank you all offers for joining. Would you like to make an ending statement anything. You want to add no comment thank you nice go thank you thank you everyone hey everyone thank you for all the questions we are.

Going to start with our next session in around two minutes. So we will see you then you hi everyone welcome. Back so let me just add you to the stream hey Joe how are you good morning yeah Joe is!

Joining us from UK where it is quite early I can see you're having your coffee. So yeah let me just add your screen yeah Joe why don't you go ahead and introduce yourself and over to you my name.

Is Joe I'm an Android engineer currently working at a company.

Called buffer based in the UK so yeah!

Nice and early for me this morning but I'm happy to be here and be talking about Android 11 and how we can. Adapt our applications to some of the changes that are coming so yeah it kind of going off. Of the talk that the sessions that we just watched and hopefully duh some.

Insights that this session will give you so before we get started just wanted? To mention about any questions if you've got any questions that come up throughout the session do put them into. The chat and the organizers will have them ready for the end of end of my session.

So I can answer them and this just helps with the flow of things and likewise if you want to reach? Out on Twitter and I think my twitter handles on the? First slide that at hi there Joe so feel free to reach out there's.

Any extended questions that you might not want to ask here so with that in mind I'm gonna go ahead.

And get started so privacy changes and privacy as we know and as Android engine. Is there are this is an area that's constantly changing in Android it's evolving and you know that it's for the best.

It's for what our users want people are more concerned about privacy. And I'm sure as users of Android ourselves we also have the same thoughts a byte and I remember the first time that we had:

Like bigger changes we saw script permissions introduced in Android 6 which required a lot of changes and having to request!

Permissions when they're required and then having to be sure to check those like as if they're those! Provisions are changed and and so on that was quite! A big change for the development workflow:

For features and then we saw privacy improvements gradually put in price place as he went through hundred! Seven hundred eight hundred nine and then Android ten we saw the introduction.

Of scope storage as well as restrictions on background location access things have always been changing but the changes that were made in Android. Eleven kind of paved the path to evolve.

Into an even greater Android platform in terms of user privacy and when it comes to a lot Android 11 we see even. Further changes here to improve the privacy that we have in our. Applications as well as the data that our applications can access so in this talk we're going to cover.

All these enhancements that come with Android 11 so some of these are changes that we are required to make and some of them kind of enhancements are offered to! Help us understand more about the data that we are accessing so first one and seems very fitting as we were just talking: About permission changes and so the first change.

Here is what's known as one-time permissions so when given a choice. Users are choosing to share less and less private data with the applications: That they're using and Google also saw that there are many apps which were requesting background location access when?

They didn't actually have any need for it I'm sure we've all open applications and being bombarded with permission.

Requests as soon as the apps launch and you're like what's! Going on why is the apps need this and and it's quite has been quite habit. For application is to group the permission request because it deems to be easier so based.

On the feedback from users and developers androids. Can be giving more users even more granular control over the privacy of data so this includes location access.

Camera access and microphone access as well as significantly limiting access.

To background location so a sickly look. At a couple of examples so users will be able. To grow on temporary one-time permissions for occasion permission requests and also for microphone access.

So let's suppose this is an application such as a conferencing up that is rarely. Used you know we go to copper at the moment:

We don't really go versus in person but when we go back to codes Congress? In person you're usually have an application you have the schedules and you know you use that application maybe once a year twice a year.

And so you're ready using it and granting permission for those applications that you rarely use seems like a heavy. Burden and so in these applications users.

Can make say voice only calls and so on um with these one-time permissions users have the option to not permanently commit:

To that permission such as to record audio permission and you know you know when you're granting that permission you're. Using it permissions only use at that.

Time and as soon as you leave the application that permission is revoked and the same apply is to camera access.

If the same app also supports a video calls the app would request the record video permission and the same would happen. When the app would you have to so you may have this important question in mind what. Does this mean for me as a developer what do I need to do to support this and the good news.

Is that if you're currently following the permission best. Practices you don't need to do anything. You know if we as mentioned do the last session if we're following best practices of requesting.

Permissions when they are required and checking the permissions are available when!

We try and access them we shouldn't. Need to make any changes in our applications here so let's take a little example in terms.

Of some pseudocode so say we want to access a location feature in our application and what happens here on the left hand side! Is is what happens if we follow the permission best practice and so first we check if the permission!

Is granted and when this is first run. For example the permission isn't available so next we will.

Let the system decide if we should!

Show some form of in app UI to give an explanation of why we need that permission so normally. Not always the first time the system will!

Consider that that is needed and finally. We get to the point where we need the permission so say but this! Is the first time requesting it so in this case we request the location permission.

And this lets this prompts the system will prompt the user with the free. Options and and this will be whether the user wants to grant it all the time or grant it this. Single time or tonight so let's say the user presses the deny button!

In this case the on request permission result.

Callback will be invoked and the permission. Will be rejected and so when this happens again we should make sure that we explain the functionality will. Not work and without that permission and maybe you want to use a snack bar or some other!


Form of in-app instruction and and that's what most applications are doing this at the moment and if the permission is requested. Then you know you can carry on using it and but the important important thing here is that best. Practice and might it may be all apps case it's already following this but being?

Aware that the user has mentioned again in the previous session I think Chet said your user can revoke these permissions at any time!

And and having that one-time access I think strengthens on that statement even more like that can that. Can not be available the next time I'll user launches the apps and we need to make sure that we're checking.

The permissions and handing them correctly and so if the user grants.

That one-time permission in in that pseudo code so in terms of some examples of. When this data will be available and so with that permission granted that single.

Time while the apps activity is visible that the permission. Was granted in the application can access.

The data if the user brings were apt to the background. Your app can continue to access the data for a short period of time I don't think there's the define amount.

Of time and but it's let's call it short period of time if you launch a foreground service. While the activity is visible and the user moves to the background then continue can continue to access the data until.

That service is stopped and finally the user revokes at one time permission! Which can be done anytime in the system settings then kind of your access! To that data is killed um regardless of whether you launch with foreground service or so on and that is not available anymore.

So once that permission is revoked at one time permission the next time user goes into your application. And that permission is required we go for the exactly the same process again and that permission.

Will need to be requested and that same lifecycle will happen and yeah so I mentioned if you're already!

Following the best practices for permissions that were introduced in Android 6 like Scott and the scoped permissions you should. Be fine here but it's always good to test it and make sure you test these changes.

Just to be sure you provide a good experience. And maybe there's a chance to improve things otherwise and when it comes: To location permission the location permission is a special?

Commission and and the aim here so in Android 10 we wanted to give users find grain control over location permissions because.

Location permission is in but it's a big privacy concern like people don't women: Want to be exactly like known knowing?

Where they are and sort of monitored so in Android 10 these permissions were splitted into four grounds and location access.

As well as a background occasion access so apps are encouraged to in currently request these permissions! To give users better control so you asked for. The foreground permission first followed by all time location access and so this was in Android.

10 this was recommended to be followed but now in Android. 11 this is a requirement so once you target Android 11 you will need to request the foreground permission first followed. By the background permission when it comes to Android 11 and there's.

No change to the way you request the foreground and permission so we're currently. On the screen you can see a way for requesting the submission and this is how we're pretty currently be doing it in our applications and that's fine that.

Will still work in under 11 there is no change required here and over for background access there are a couple. Of changes when it comes to Android r and so to begin with the first point. It's good practice as we mentioned to incremental e request?

Permissions as it gives users a chance to understand and decide based on context like foreground permission you know it's only accessible when the apps?

Open and that C was less of a commitment the background access is a big thing so asking for both of those together! Is a big commitment and you should only ask for background location after your app has been given. Foreground access so as I mentioned this is recommended on Android 10 and but it is now a requirement on Android 11 when your app requests.

Background location permission and this is where the change comes in and the request permissions. API will send the user directly to the settings screen so instead?

Of the regular permission request dialogs and so before this happens it's good practice to educate the user before requesting. That extra permission is some sort of UI because as soon! As they look you show you as soon as you send the user to system settings!

Kind of the outside of your app essentially so there will not be an opportunity there to explain why that's. Needed so before that happens it's good to show UI to explain that just like. We would for other permissions and secondly make sure to provide.

The option for the user to refuse and don't just send the user to the system settings without offering the opportunity: To refuse it this is because there are rate limits and around like sending. The user to the system settings screen and has a similar result or behavior to denying a permission so if you send.

The you to that screen it does count to your rate limit so don't just default to that and make. Sure you should to explain and offer the chance: To the user to deny it and so this is obviously a little bit?

Of a change and to how we're used to dealing with things and however this does make it easier for us developers: There's no new API for this system permission we just you know the dialog.

Will send the user to that and handle it for us and so that's great.

For us although it's a change it's great for us and an apps get to control the UI for most of the process. So as I mentioned we had the chance to display to the user why they're being. Sent there and what that permission is needed for and.

But that is now handled by the system.

So just to iterate back on that point of the rate. Limit and it would be worth reading up on the documentation to see how your app might behave there.

But that will behave the same way as if permission was denied cool and so to ensure there is still compatibility for apps targeting Android. 10 and whilst this is a big change for Android 11 and descending the system and we're having those two location permissions split.

For Android 10 and it is still allowed to request both foreground. Or background permissions at the same time if you really need them. And it's still recommended to do them separately but if you do show them at the same time then an extended dialogue.

Will be used that can handles both cases and that dialogue will still and give the functionality of sending. The user to that system settings screen to manage that setting. And so that is there if you need it and still if your applications using that way maybe think about following best.

Practices if it feels right for your application so one thing that is new in Android are so and if your. App hasn't been used by the user for several months I'm sure we've all got applications. On our phones which people have forgot about or just haven't.

Used for awhile and one cool thing which I'm actually quite looking forward to is the system will reset your application of submission!

Automatically if the application hasn't been used for several months so this will be as if the user has reset the app submissions within your application: Settings the user can turn this setting? Off on their device but and yeah this was this is essentially goes strengthens what was being!

Said earlier again let not only now.

Can the user reset your permissions at any time or revoke your permissions the system.

Will also revoke your permissions after a few months of not being used so if you're following best practices. And you don't need to make any changes.

You're checking permissions before accessing sensitive data requesting if you don't already have them and handling them gracefully and if you're doing that you're. Fine because if they're revoked you'll just request them when they're. Needed again which is good practice if you're not doing that currently and if you were you know testing this on Android 11 Android our reach permissions and?

Seeing how application behaves and catching any cases or edge cases where this happens so this only affects. Apps that target in the API level of Android xi so this won't affect about applications so most apps will not need this.

But there are certain cases where the user expects an application to primarily! Work in the background and so the app can consider redirecting the user to the app detail settings.

Screen to toggle auto reset for the app so this is an intent that which can be launched and you can you can take.

That user directly to the screen to not reset those permissions not advise using. This unless you've really need it because if you are having to if you're sending the user to to that screen. To to toggle that and like it like I said like I said in most cases this will not be needed.

And if your if your application needs to work in the background most of time with users reopen. It that might make sense but personally. For the best practice and the user being able to reset the permissions or the system should not be a concern for you so yeah and.

That's compressor ask the permissions and that's all the permission changes that are coming in Android 11 and there are some changes: There but most of them were following best practices and we shouldn't be too affected by them if there's any questions!

On that feel free to to push to ask.

Them in a chat and I'll do my best to answer at the end of the session. So next data access auditing and so this is more! Of a developer feature I guess as you cool.

It and and it's actually quite interesting so this isn't a new API just support to discover potentially unintended access to private data for the application. You're developing so when it comes to building mobile apps one of the best practices.

Is to ensure transparency when accessing private. Data so for example it should be clear and obvious why a video. Calling up needs access to a user's contact information and/or any app minis specific.

Access to a certain type of data when it comes to identifying data access within a project and so it can be difficult. To identify this and what's weird you know we're developing features and we know most the time or we check what data our features are accessing. And it can be hard to know this in some cases:

So so for example and large apps often have orphaned. Code and have large teams accidental data access can happen in these.

Cases and we're working with code we might not have used before don't notice: There and could still be access in data without us being aware of it any apps may use closed source. For party SDKs these SDKs may access private data without us knowing.

And there could be like piggybacking off of the already the permissions all users will have granted. With an application and accessing data and in these cases like this isn't about pointing the blame. And saying developers are accessing data they shouldn't this is this can be unintended and it's these things as I mentioned.

Aren't always easy to identify so this isn't about. Pointing the blame this is just about how it trying to to be more aware of what we're accessing on behalf of our users and cool.

So and therefore so in Android 11 we have two new api's to bring to give control.

To developers over the data usage in applications so first feature is is essentially a callback that we can use to retrieve.

Data and retrieve notice when data is accessed and on top of that we also have functionality to allow developers to attribute. Access to logical features through their application so let's break these down a little: Bit so in this picture here we have each blue line represents a piece of code in the app and the grey line.

Symbolized that this code is accesses certain private data so we have many different bits of code. Acting accessing location made different bits accessing.

Contacts and so on and whenever the app calls an API that returns private. Data and with this API the system calls into a collection handler immediately. Before returning to the calling code so hence at this the collection handler can collect a stack trace to record.

Which code performs the access which means developers can be aware of the functionality that is being used so let's look at the API so this?

Shows how to set up a callback. For data access through the app ops manager.

Class so if you want to consistently track it for the entire app you can set this up within? The application on create function say you want to localize. It to a particular part of your app you could do that within the oncreate function of your activity so within.

The unnoted callback class your app will be notified of data access in synchronous calls so when this happens. You may log the stack trace to help you identify the source of this access during development and for asynchronous: Access for example when your app registers a callback listener and so it's recommend.

Checking out the API reference for more details on this and that whether you using. That callback maybe you could work these things locally during.

Development you could also if you're using some form of tracking system and analytics you could also attract them through there. And keep a track of what data is being accessed in a more sufficient monitoring approach so more complex apps often contain. Multiple distinct features so maybe we have a mapping.

App that might have navigation might be able to explore shopping maybe find friends. Feature and so on and these are quite different features that require. Different kind of permissions in android 11 for this and you now allow for an app to attribute a subset of the app.

As belonging to one feature so each of the features uses a subset of private data so eg the fine friends feature. Might need to use the microphone it just needs access to contact in the location having.

Features as a high-level concepts compared to just areas of code makes it easy to find what features. Have accidental data access and so so this will make it easier to explain to the user what private data is useful so this. Can help us for example maybe our fine friends code would be accessing the microphone:

Data and at this point be like what's doing that I didn't even know that was doing it and so we can remove that access?

Tidy our code up and using this API and help to you know bring more and transparency the data that is being: Accessed so the data auditing API allows you to add to Butte data access to specific features?

As shown on the screen so let's have a quick look at how this can be done using this API stat repeat. These features in your code you can create an attribution context and give it a meaningful name. That corresponds to your feature so for example in the case of the fine friends feature.

And you can see here you can yeah. So you use the create attribution contract function you can then pass this context to API calls and within the data auditing. Callback you can recover the attribute for this variable attribution tag so for example you can then track the attribute.

Of your analytic solution and associate a particular. Feature with private data access so yeah once we set this attribution context and by creating it we can then access.

The attribution tag and when it comes to the callback from our own Ops note callback so this is just a you know doesn't. Seem like much but it says for developers. It's a simple API to last breakdown features and logically track.

The data that is accessed by them and not all applications might not have use for this but I think! It's an interesting interesting thing that can help us you know make more sense for applications especially with working with larger.

Apps and code that we're not too familiar with.

Really helped us improve the privacy side of things cool so moving. On to service types so there's some new foreground service sites coming in Android.

11 so to provide better accountability for apps to access private data in the foreground service there are a couple of new foreground service.

Types and these are the microphone and the camera so Android introduced the concept. Of foreground service types in Android 10 and so apps can declare their intentions to access this info within its foreground service: So only at this time only two types were enforced so there was media projection:


This was stuff such as an auto Bluetooth? TV our dice is using connection and in that way and also had locations: So this was things such as GPS maps navigation!

Location updates and now there are going to be a cop of other defined! Types and and this will be for the camera and the micro so there's a couple yeah as mentioned.

So there's a couple of additional foreground service? Types in Android eleven camera is one of them so going back to Android nine.

And apps could no longer access the camera in the background so for quite some time this could only be done on the. Floor guide anyway so in terms of developers development this isn't too much for change for us um if your app. Targets and rule 11 it essentially needs to declare the new types so if you're using the camera and in the foreground?

You essentially need to declare it otherwise the foreground service will not receive. The data from the camera and so here we see what we need to add to our manifest and this is the manifest entry. For the camera foreground service if you need to access different data from different foreground services such as the microphone.

Which you previously mentioned then you can defend? Together so you don't need to add a service entry for each single one you can simply declare them and using the or operator cool so that's quite. A short section but just to recap if you need to use a foreground.

Service to access any of this data so location was already something that was in place in Android 10 camera and microphone or new.

Foreground service types if you need these in the foreground service. You must declare them in your manifest otherwise they won't work and so yeah the small.

Change but a really important thing to be aware of so next topic is package fillers busy I know there are a couple of questions: That came up on this in the last session so maybe this will help to click on some clarity to those.

Again if you got any questions drop them in the chat so in Android 10 and odor and this API and others. Allowed an app to see which other apps by just are installed on the device. So when I when I first saw this change I I was like I just saw the function corners like oh that's.

Or that bad and then I read the description.

And reading that was like allow an app to see which other apps are installed. In the device in my head I was like oh wow that's actually quite a big privacy concern.

And you know it was just seeing the function you don't really. Think that by seeing it broken down does actually. Open your eyes a bit and think yeah I can see why maybe this is changing.

And it seems it makes sense and so to provide better accountability for access to installed apps on a device so Android leveling. To include some changes to how apps can both query and interact with other apps so for several common.

Scenarios where you may access the installed packages on a device you do not need to make. Any changes for example I'm querying the package manner I'm sure for other applications this is a common. Use case should not need any changes and so if you target Android 11 and get package info followed by get package name which.

Is for your own app this will return the package. Information for your own application because you're requesting.

It if your application that's allowed that work is expected no changes required there and I don't.

Think that and might be a surprise and that is fine you're doing that making sense and however if you called.

Get installed packages and again unaffected this will return.

The calling up certain system packages such as a media provider and anything?

That influenced the core Android functionality if you send an implicit intent for another app to take action maybe you're using an image! Capture in 10 photo picker in 10 or so on and whatever implicit intern you're accessing this will work as intended.

Because implicit intents are allowed and they're fully supported still in Android. 11 so that's also an unaffected operation and if there's more than one app that can handle that intent then you'll!

Be sure the system will show a dialog? For the user to choose the app from again another unaffected one and if you another app cause your apps contact rider and expects:

Results then that will still work as intended because the.

Content provider is there to provide content for external apps and so that's going to work as intended and that's. Fine so as we can see there's already a collection of unaffected interactions which most apps are probably using so if you're using those:

There's no concern for those operations so however the changes that will affect our retrieving. The package unify for another application so if you try to get the package in the phone for another app a name not found.

Exception will be far will be thrown so even if this. Comm dot another app application is installed on the device calling this get package info will will return a name of an exception. So that it can't be handled and let's take a quick look at how we can do that so if you need to explicitly.

Interactive another app so for example your.

Application may need to invoke a specific activity in another application or it may need. To bind to a service we can use a new queries element in the manifest.

To explicitly specify the packages your app needs to query or interact with so if we add this package declaration. To our manifest under the queries tag our application can now query for the those package names and we can add multiple package names.

And to provide support for that without an issue or you can do this implicitly through. An intent filter signature so the app can now query for all types at handle and action send intent for Jacob:

JPEG images eg to populate the custom share sheet and these apps will now show up in get installed: Packages results and so as I mentioned and this cool or not work unless you add the queries tags to your manifest?

So that is the main that is the essentially the change that this is introduced. In Android 11 of operations will still work if you're accessing operations like this you need to add the correct equations.

To your manifest and the best way to test this.

To be honest is set your app's:

Target SDK version to 30 and don't. Add the queries tags I think it's important not to just start adding queries tags because you think you need them and!

Don't add the tags and test your application and maybe where you're calling these functions and essentially see what features of your application. Are not working and if a feature is not working! If the interaction with the other applications is not functioning correctly:

They don't need to add the queries tags and yeah so just iterate on that don't just start adding. Tags because you feel they are needed and let's test it and then go back and add them to fix functionality!

So in practice we found that most apps can easily express necessary package interactions with intent and package declarations and however and there?

Are some cases that Google did identify identify where. Query all packages permission was needed and again don't just add this this isn't something that most applications. Should need to be honest and I know:

It's like reminds me of the request legacy storage is easy to add and but we don't if you don't need it don't. Add it um again Google did that Google have specified that will be used cases for this if you are an application that might need this and.

Please do give pass on feedback to Google as to why it's required or any any feedback there is but um yeah it is available! If it's required so sometimes if a social maybe a map app or so show up fires a viewing tent for a certain URL you want. To be able to take users directly to your native app that can handle URL and also known as deep links:

So if you did this and your.

User will get a disambiguation dialog box and making?

The UI kind of janky and so on Android 11 a couple. Of new intent flicks so one of which is a flag activity require non browser.

Flag but so this ensures that the intent is only. Handled by a native app so if one if a native app isn't available then an activity not found except. Your own and in the exception handler you can choose to take over the handling in turn eg display.

The URL in a chrome tab webview Ravine application so there's another similar intent:

Flag called a flag activity require default and it ensures that there must be one default!

App that can handle the view intent else it also results in the same exception so you can override the experience for a user. And so to discover more details about how these changes the package of visibility will! Affect your app you can enable log messages for package filtering.

And maybe you're developing a test app or debug your app in Android studio. And this capability is already handled for you enable for you so otherwise you can run the following command in your terminal.

Window and enable manual and so then when when you run this when this is running.

Whenever packages are filtered out of a package manager objects for turn valuables you see a message similar to the the showing:

On screen so just to be aware. The this will affect your application performance and so make sure you it's pretty good practice?

To disable this unless you're specifically testing for package visibility behavior just to avoid any issues. With performance during testing and debugging and yes so that's kind of it in terms of package.

Visibility and a new eight handle deep links and there's also the restriction. Is now on accessing installed apps most changes most cases here will be unaffected and the best thing to do as mentioned. Is set your target SDK to Android R which is API level 30 and test the packages so available where needed?

Cool scope storage and probably the one a lot of us a lot of people have been waiting. To hear more about and I know this is an interesting one on Android 10 which as mentioned in previous. Sessions some pain points for media access.

So and it's good to have some more contacts here.

So let's look at scope storage so before the introduction of scope storage in Android 10 there were two classifications of external: Storage that we had application storage and we also had shared storage so any apps with storage permission had access. To all the shared storage and Android 10 scope stories changed this by adding a distinction.

Between media files as well as other documents so rather than apps gaining access to all files instead in shared. Storage and there's not only have access to media files:

So in order to gain access to documents which. Could potentially get a more sensitive data and the app needs to ask the user to grant access specifically to these. Documents so on screen we can see the specific.

Scope storage changes that came in Android 10 so unrestricted. Media and downloads contributions only media collections can be read with a storage.

Mission location meted metadata and required permission.

To be accessed and the system picker was used for other file types and the reading. Or writing outside of collection requires the system picker so this was enforced. By the SDK but we did have the opportunity to opt.

Out of this as some for some applications. There was a big change so there was a lot of feedback received from developers and around this scope storage and because: You know people need their time to migrate and that's.

Why the temporary opt-out was available via they request. Legacy external storage attribute and after you update your app to target and/or 11.

The system will ignore this so if your app pops out of scope storage when running on android 10 devices you can continue. To set this and and your application will behave as expected on android.

10 but android 11 this the system will now ignore this flag and the android 11 improves upon the scope.

Storage in a number of ways and then we've come from andhra 10 so there's been a couple of changes that have been made. To storage so these changes take effect. In Android 11 regardless of your apps target SDK version so to begin with the storage!

Runtime permission is now renamed to files and media. And with your when you're targeting Android.

Version are which is a API level 30 and if your app has an opted. Out of scope storage and requests the read external permission users will see a different dialogue.

When compared to Android 10 so this dialog indicates that the app is requesting access. To photos in media and users can still see which apps have the read external.

Social mission in system settings by going to their privacy permissions manager and each app that has the permission! Is listed under allowed for all files so if your app targets android 11 the the right external storage permission?

And the write the right media storage privilege permission no longer provide any additional access and it's important. To keep in mind that device is running under a 10 or higher.

You can still contribute to a world to find media collections? Such as downloads without requesting any storage rate like permissions and that these to the missions no longer provide: Any additional access on top of what is already granted so in Android 10 and user consent was required?

To edit or delete media that was not contributed?

By your app so to do this you must use the media store API as to trigger a dialog:

To request user consent and if the user. Accepts you'll get a callback into your app and can proceed to access the file either within the media! Store api's or by using the file path so in Android 11 we're improving the user consent flow for editing or deleting media so you can now.

Batch multiple edit or delete requests in one third rather than pop $1.00 per request which could probably get quite annoying for the user and this. Will significantly improve the user experience in applications and was actually quite a sort of a request.

In under a 10 so and I think Google quite looking forward to people having access to this and you always! As developers in our code we always have the option to copy the file to our apps. Directory on external storage and edit a copy but would only be recommended.

For one-off edits and for small size files since obviously we don't. Want to clutter the users disk space and if this is done and be sure to provide option.

Within settings or so on to clean up when requested so let's. Take a quick look at how one of these batch operations might work so after calling the create. Request for example the system builds a pending intent object and after app invokes this intent users will see a dialog.

That requests their consent if your apps update or delete there's.

A specific the specified media files so on the result you want to evaluate the users response? And Eve proceed or the users did not consent explain to the user while your app needs permission this makes it nice!

And clear as to why that's required and this operations will work the same whether we're doing the write requests the delete request or the edit.

Requests or so on and but once that's allowed we have access to those mini files and we can hand them. Within our application so also with Android 11 are coming some file access restrictions and so there's a lot of information is on this:

In the develop documentation and but depending on how accessing files there might be some. Changes that are required so with the open document reaction and when accessing documents on the device your user can no longer.

Access the following folders and files from the documents UI so this is the root of internal? Storage on the volume SD card warning the Downloads directory the Android data directory and all of its sub directories and the: Android adb directory and all of its subsequent subdirectories and so that's quite a could:

Be quite a change for some applications and there's also some changes similar to the open document action: And that can only be used to request that the user select. Individual files from again sub directories being the Android data at direct.

800 data directory as well there's the Android OB directory.

And so a subtle difference is there open document tree can't access the downloads folder or the root as well as the corresponding sub.

Directories open document and just can't access the subdirectories. Of the android one specifically being data and OBB directories again. If your application might be affected by that and please check out the private stock that privacy.

Change documentation on the android preview developer site so direct file path access for media so the general guidance for accessing media files is through the media store because that:

Lets the system better manage file access and is also more performant. And it's kind of like the safest way for us to access files are for our.

Application so in android 10 I guess to kind of enforce that:

And trying to encourage more people to do that direct file path access was locked down um however: Developers gave a lot of feedback that that wasn't always possible and and and because this can be quite important!

For third-party libraries such as ffmpeg and that's one that needs it and probably many offers. So in response that is being renamed in android 11 so direct file path access for media provides.

A native far like interface to media store to allow apps and libraries to continue using file API to access media content if this is. Something your app needs the recommended approach is to opt out of scope storage with a manifest.

Flag on android 10 and that'll mean that you can support the same approach. To media access on both Android 10 and Android 11 so with direct:

File path access on Android 11 opting out of scope storage on Android 10 will mean you can still access media using direct. File paths and however only use that if it is needed and if your if you were like an application that. Doesn't need that specific access and if you can access!

Files through the media store that should be the way the you are accessing files and I would still highly recommend. Not opting out of scope storage if you can remove that and supporting access. From the media store and is the suggested way to do it and there.

Are many reasons in terms of performance and developer experience to do say so yeah before impacts of direct path access?

So keep in mind that the API does support an OT file access and it is built on top of the media store and it's primarily intended. For apps and libraries that rely heavily on those api's:

So because it's built on top of the. Media store there can be some performance penalties.

For using it so if performance is your number.

One priority use the media store API and if you don't need direct file paths access use the media story PI's.

And based on some tests that are being carried out these operations are most expensive for opens and also first. Feeds and I'll see the more your app uses it the bigger the impact that will be seen so just iterate again I'm going to sound like. A broken record default in the media store and only use the file path access if you really?

Really require it and cool the last change for scope surge and so as I am Android who wants to continue allowing. Some apps to have broad access to files and on external storage and providing.

They have a use case really requires it and in android 11 apps can. Declare the manage external storage permission which will allow them to access a user to grow on all files access in settings and sounds.

Kind of dangerous but there are a couple.

Of app examples that will be allowed so file managers? I think there was a lot of feedback and concern other file managers? For file access and so apps whose main purpose is to let.

Them manage user files will be allowed to access. His setting applications that primarily offer backup and restore so recording bog access to files such as switching devices or backing?

Up in the cloud and however if your app requires access to a single file such as a word processor. App you should instead use the storage.

Access framework and but I recommend looking at Google Play and the guidelines for this permission and when it should.

Be used and how it should be used and if you do fall into an application that needs this. If under your development and do reach out to Google and give feedback on it and this is obviously:

Quite a big Commission and it's really important! The correct feedback there from from the right people cool.

So let's scope storage and to finish up just a couple of other important changes. That are coming with Android 11 around privacy so before and or 11:00 the read. Phone state permission covered a broad set of information and this is a good this is a really good example of giving.

More granular control over the permissions for a specific feature so the read phone state permission would give general!

States such as is the phone ringing or is the phone idle but it would also give private.

Information such as phone numbers and this is one of those things again where.

When you read that permission name you know I don't read. Phone st. yeah that doesn't sound too bad like just was a state of the phone but when you dig into. It you start to realize like reading reading that back and what.

I just said um it's kinda like oh wow so that's. Actually accessing a lot of private data and and that kind of opens open my eyes a bit more about okay these: Changes are really needed and so as we can see we have the generic information for cool States and we also.

Have a lot of private information you know terms of phone! Numbers and if your app attack targets Android oh and the permissions become more fine-grained so read phone numbers.

Permission covers and the teller telephony manager API in the telecom manager API and whereas. Yeah so read phone numbers is those two! Api's and and that means that essentially now when you want the phone state you used the first permission and when you want!

The phone numbers use the second person and if your app is using read phone state and you're targeting: Android are and be aware that you will need to split those.

Permission requests up if you need both of them and as required so if your app I mean these phone numbers. You may just want to declare your permissions like this and and request. The only ones that you need again they need to be added in your manifest.

But just request the ones at one time as they? Are required and so a couple of other small changes and MAC address! Restrictions I'm not going to read everything was on the screen there and essentially.

The general guideline here is to not work with MAC addresses and why so MAC addresses are going unique and they're not user accessible. And they and they will survive factory:

Reset so it's generally not recommended to use MAC addresses for any form of user identification and devices running Android.

10 for example and uses randomized MAC addresses to all apps that aren't device. Owner apps so an android 11 and sees these following. Changes so you could no longer access MAC addresses from outgoing interfaces and so on so if you want any more information.

Read up on the the the developer preview site if it changes? Here but yeah the general guideline is to avoid using these possible and so preloaded apps are still granted the permission by default for system alert.

Windows so and the this intent no longer supports a package. Name being supplied in the day to your iso and ivan.

If you used actually use this intent but i know that when you! Previously launched it you passed it your eye and it would.

Be taken to the overlay management screen for your application so that is no longer the case you can no longer. Pass that your eye for the package:

And when you launch that intent the! User will be taken to the screen it displays all apps and the user will need to select the specific app on the screen I think this.

Makes sense because and if you could pass package name you could you know you could provide any misinformation and users. Might just gone for mission or acquired and obviously this is quite a big Commission so and giving. The user control to select the application even if it means it's a little bit more work for the user to select:

It it's a lot safer and more secure and so essentially the action here is normally intend and the user will be shown. A screen to select which apps can draw on top of apps and so yeah a bit of a change but for users it should provide: More privacy cool so that's it that's the kind of overview of privacy changes and again that if you look into the developer preview.

Write-ups in the on Android and the developer preview site probably: A few more smaller changes and these were.

The bigger things that to be more aware of I would really advise you looking into the developer preview: Documentation and seeing what's there and having a look and really understanding these changes and seeing what your application needs to adhere. To and yeah so those big changes in locate like location access and permission access scope storage.

Are the biggest ones for me but if you're following best practice in a lot in a lot of cases these shouldn't be too! Much of a change for applications and again just want to iterate on the testing upgrade to Android 11 um change.

Your target SDK and test your app see what works see what doesn't work.

And then make changes based off that and I think it's good practice to avoid.

Just changing things for the sake of it and seeing what. We really need our application to do and what we need to adhere to!

And cool so I hope that was useful I hope kind of open your eyes maybe giving. You a bit peace of mind now and not not made. You worried about any upcoming changes and if anyone's got any questions I've got some time now is there.

Any asked happy to answer some and likewise if you feel if you want to now reach out to me on Twitter. At highlight Joe and I'd be happy to talk there how'd you hurt thanks for the informative session I think it was really good. We do have few questions on the comments so I'll just highlight.

Them for you so in the case of wall and use if for ground service. Gets killed on a resource of an app in the background they will have access.

To that permission oh that's a good one and I don't! Know for sure and if the foreground service.

Gets killed and it restarts I I'd have to check I presume so and but I don't wanna give you any false information yes I assume. It would still be available for use because the foreground!

Service would essentially still be running and that would be a good one to test. And maybe that's a good one for the Google team to answer if if there's any opportunity? To yeah so not completely showing up and you could ask them back-to-back I guess I would avoid yeah I would avoid asking.

Them together and like on under 11 we can't. Anyway and but yeah there is as long as you give the reason like the right explanations personally it would.

Feel to me a bit intrusive like you know here we get asked permission. After permission it could be a bit annoying so yeah if I'm trying to think of a reason. Why you might need that and my advice would.

Be ask them where they're required so also asks for the foreground permission. Where it's required and then we need to back confirmation ask it and if there is a case where you need them.

Both at the same time then I guess you would have to do that and that would be fine but in any way where. You can ask them separately where they're required and maybe trying because then if you are somewhere they required you can have that time going straight. Between the two and there isn't any restraint in terms of developer and development but just thinking.

Of the user experience there and as far as far as I'm aware? No these a lot of these changes are required for Android 11 and shouldn't.

Have any chat any impact on Android 910 as always do test your apps on different Android.

Versions after adding support for these newer things to be sure that's not something I've used again I'm not I'm not heavy. User of deep links in development and not something I've used too much and the main reason for these intents is to provide a good implementation approach.

For deep linking when it comes to launching URLs yeah I've got too much coin in there because! That's not something I've really used again. There's nothing about that specified in the documentation and so that could be something.

To play around with if it's like you're using applications and see how that behaves not from a privacy point of view. I know there are some accessibility changes in Android 11 and be worth checking: Out the Developer Preview site for that and comment what they are but there are some accessory?

Changes they're not huge changes but I member there being some coming up 411 mainly improvements. And a few subsidies to offer a better.

Experience but in terms of privacy and I didn't spot I don't think they're okay we end the Q&A for now Joe's twitter handle. Is available to all of you so if you have any questions.

As I said earlier you can reach out to him thanks you for joining us and giving us this deep dive into Android. Privacy yeah bye okay so with this we are going to end our session for today one quick update?

That a lot of GDG is around India are also doing android 11 meetups so there is this site. Where all the events are available through GDG Coimbatore Chennai an output so you can attend.

These sessions later they're on 27 June for July and etcetera.

We are also going to do future meetups so our CFP forms are available so if anyone wants to you know talk.

About anything in our future because to fill those cf3 forms we are available on meetup stack and twitter so if you have. Any feedback or do you want to share anything with us do share with us on these.

Channels so with this I am going to end this session thank you very much for attending by.

Дополнительные материалы

Поделиться или сохранить к себе:
Твой успех