Now in Android: 17 – Android 11 DP3, Articles, AndroidX releases, and a podcast

[Music] hey everybody welcome back to now in Android this is episode number 17 let's get into it so Android 11 developer preview 3 just came out recently with a lot of improvements for debugging and developers which is good turns out I don't know about you but I occasionally write a bug and it's kind of nice to be able to actually debug that thing hard thing to do especially in the real world on user devices so we've come out with some new facilities to make some of this stuff a little bit easier for you along with a bunch of other developer features for example wouldn't it be nice if you can actually figure out what was going on the real world when your app crashes so there are a couple of features specifically about that first is a new API for querying information about why did my app crash right so you can find out after the fact you can basically get this data structure back a list of the reasons why your app exited and then you can upload those and take a look at that data again this is real world data so much more useful than what you're going to get in a test environment with very different devices than your users might have also for NDK developers we offer something called G WPA sense so in Android 10 we had this thing called hwan Hardware Aysen which was hardware accelerated it caches memory problems but it's a little bit high overhead it was really meant for sort of build and test environments development time stuff G WPA sin on the other hand is intended for the real world in fact we use it for the platform libraries ourselves it's a sampling based thing where occasional allocations will go through the system and be sanity checked against validity and this enables us to with very low overheads both at runtime as well as memory catch problems that can occur on real world real user devices and when one of these problems occurs it will be logged and it'll show up in your place to our dashboard so if you want to enable this check out information about GWP a.


wireless debugging so I think in these times of uncertainty we all want to grab on to the things that we can count on one of those things certainly is that there are never enough USB ports am i right so what we've done is enabled wireless debugging people have wanted this I've wanted this for years and years and now it's here it's not yet in the tool but it is in the command line so there is a way to access this through the command line so that you can now actually talk to your device without trying to figure out you know what dongle do I have somewhere that I can plug in an extra USB cable into my machine so check that out and also check out ATP ADP incremental apk installation far too many acronyms in the Android universe don't you think so we have added a new tool especially for large binaries to make it faster for you to install on your device let's say you're building a game and you've got a couple of gigabytes worth of data and code and everything and it takes a while to install that every time you rebuild this onto your device now using this new process you can install up to 10 times faster so you need to sign your app differently and you need to use this updated a to be a command line tool that we have also note that this only works on pixel four and for excel for now because it required a low-level file system change but the intention that it's that it will be on all devices and actually ship with Android 11 data access auditing is a way for you to find out what is going on in my app with accessing data that requires user permissions let's say you're working on a huge app you have tons of developers or maybe you're pulling in a bunch of external libraries and you know that they are accessing that somewhere in your application you're accessing data that maybe you didn't intend and maybe you don't want to actually require those permissions from the user now you can find out what's going on you can have these listeners and be called back when these accesses happen you can find out you know it's happening from that library that says the portion of your code and you can do the right thing about it Jeremy walk on our Walker on our team has written a complan sample and this teaches you how to use the API and it uses a nice example with a separate module that is actually doing the access from there apart from the main code so you can see how this actually works in the real world so check out the recent dp3 blog and the Android developers blog for information about these and other features and certainly check out the developer preview site for android 11 for all of the information about all of the features in android 11 and most importantly test your app the whole reason we do previews and this really long cycle of preview app to preview after preview is so that you have enough time to test your app to a fix any problems that you find in your app and be tell us about any problems that you find in the platform so that we have time to fix them before we ship the final ruies a bunch of articles shipped in the last couple of weeks including a camera X preview article by Hussein Hakim he wrote says how do you wrote this article to show you how to use a simple preview view in camera X so instead of you managing surfaces either surface view or texture view directly and then dealing with things like configuration and rotation inside of this preview just let camera X handle it for you it gives you a view it's a custom view it manages the surface inside of there and you can do things like enable tap to focus or pinch zooming capability all without worrying about the details of how this actually works under the hood Manuel vivo wrote an article about dagger in Android studio there's a new feature in Android studio 4.

1 canary builds that allows you to find out more information about what's going on at the dagger injection level so let's say you're in a function that is injected from somewhere else you can click through and find out where that injection is coming from or let's say you're in code that actually injects code elsewhere again you can click through using this new tool facility to find out the flow of all these injections all over your code right yener posted an article in the common vocabulary series that shows you how to use the object object object keyword in Kotlin in the java programming language we use static to implement the common singleton pattern I only want one of these then you use static and then there's a bunch of boilerplate code to actually make that pattern work correctly there is no static in Kotlin instead we use object and that both declares as well as instantiates one of these objects and we use it for singleton pattern but with a lot less boilerplate code and we also used it for anonymous inner classes and like the rest of the common vocabulary series Murat shows you how things work under the hood by showing you the decompiled bytecode to see what's actually going on at the code level there's another article from eighty Abraham who's on the engineering team for the Lobo graphic stuff that we do on the platform and it were at an article about dynamic refresh rate this is a capability is coming out in some modern devices but we didn't have the platform capability supported yet we're typically for years and years and years probably back to the Middle Ages phones devices would only support generally 60 Hertz 60 frames a second which gives you about 16 milliseconds to compute all the stuff that you need to compute to actually render a frame right and then frame frame frame print well if you are writing an app like a game or another app that has its own custom render not a typical UI app on Android but one of these sort of custom apps you've got your own renderer and let's say it's doing so much stuff that you realize on a particular device you can't hit 60 frames a second you need to drop down well you can't just drop down to like 59 and you don't want to like drop down briefly and drop back up creating this discontinuous experience instead you need to sort of drop down to some of you can support continuously well the way refresh weights work is that means you're dropping to 30 frames a second if you can't handle 60 you're going to be at 30 with variable refresh rates not only can they go up to 90 and even 120 Hertz in some cases but they also support more rates that you can drop drop back off to if off of if you need to so check that out for information about how to use that stuff but more importantly for me check it out to learn more about how Android works a good description of sort of what's going on under the hood at below level of the rendering side of Android which I always find interesting Android X had a bunch of releases as they always do they come out every two weeks right and there's always tons of releases this time most of the releases are incremental releases either in the beta or the alpha or the RC stages I wanted to call out a couple of the alpha releases in particular for example there's navigation 23.

0 just came out with the alpha oh six classic versioning and this offers a new Colin DSL for creating navigation graphs dynamically so typically you use the tool use the nav graph editor in Android studio which overlays the XML code you can sort of interchangeably use either one of those the common DSL allows you to programmatically and dynamically create these navigation paths this is really useful especially for dynamic feature navigation so let's say you are using dynamic feature modules and you want your app to navigate to a module or a destination that actually hasn't even been downloaded and installed yet then you can create that graph dynamically using this DSL Ben Weiss on the team created the new sample to show how to do all this stuff and also there's a new guide to how to use the navigation DSL also fragment 13.

0 alpha o for this is a new version that has the new fragment result API this is important because it takes the place of a method that's now deprecated called set target fragments but even better there's a new guide about how to pass data between fragments so check out all of that stuff for more information about how to do this stuff best and then finally there was another podcast for Android developers backstage that posted on one of my favorite topics IME animations so I talked about this in a couple of these now and androids already and now we talked about it on the podcast we got together with Yoram yeah G Adrian ruse and Terron Singh from the engineering team that does all the window manager stuff and they talked about how the stuff works under the hood and how to use it to both listen to keyboard animations and synchronize your content with those animations or even to drive the keyboard animations directly and then one thing that came up on Twitter right before I started recording this is the Android 11 beta launch show this is going to happen on June 3rd and go to geo / Android 11 to learn how you can tune in to see what's going on there and finally as always all the links for everything that I talked about are on the article for now in Android 17 so check out the article for those and if you like the video go ahead and share and subscribe to the Android developers channel on YouTube thanks [Music].

Hãy bình luận đầu tiên

Để lại một phản hồi

Thư điện tử của bạn sẽ không được hiện thị công khai.