Now in Android: 16 – AndroidX releases, articles, videos, codelabs, samples, and more!

[Music] hi and welcome to now in Android episode number 16 let's get into this and see what happened the last couple of weeks first of all Android X releases pretty much every time there's a bunch of releases this time there were a couple of stable releases mostly bug fixes so check out navigation two point two point two and preference one point one point one for those stable versions there were a ton of like alpha and beta and our C releases so check those out to see exactly what came out there the two that I want to call out in particular are about animation partly because I love animation but also because it's sort of interesting the history that resulted in these so first of all there's a back part of the animator API into Android X and you may be asking yourself like why did we do this after all the animator API is date way back to honeycomb 3.

0 and the view property animator stuff was 3.

2 like all that stuff is way in history why do we need it in Android X which doesn't even go back that far it's because of the other library that came out which is vector drawables – see Keable so what we wanted to do what developers wanted us to do for years was provide them the capability of programmatically setting the time of a vector drawable animation so instead of just saying start and then it runs what they wanted to do is actually pause it along the way resume it and even programmatically set the time set the the fraction of animation that it's going to go to which is a great idea but it depended upon platform capabilities that were not introduced until later and so we really couldn't put it in Android X because it didn't have the platform capabilities to depend on so what we need to do is pull out all the animator stuff into this unbundled library along with all of the bug fixes and API enhancements that we've had over the years and then vectordrawable see Keable could depend on those changes instead so we released two of those one of them is core animation 1.


0 as well as vector drawables see Keable 1.


0 these are both alpha releases on the other hand they depend on long-term capabilities from the platform so they're certainly not as new and some things that you may find in an alpha one state but check those out if you've been waiting for that capability please try that out we have also come out with lots of articles and videos along the way first of all in the data space Murat Jenner has released an article on the new database inspector this is in Android studio 4.

1 Canary level 6 so with this tool you can see what's going on with your database so if you're using sequel Lite directly or through room you can actually see what's going on with the data you can do live updates in the tool or you can also even make changes in the tool and see live updates in the app itself especially if you're listening if you're observing on that data using the room api's we had another Kotlin vocabulary article posted by make Megan beta and this one is about operator overloading so this is a capability that was not in the Java programming language but is in the common programming language because it can be right this is a convenience that makes your code more readable for some cases where it's really easier to read code that is showing exactly what the operation is instead of calling a function so for example if you have two point objects or if you have two matrix objects it's kind of logical to be able to see in the code that you are adding these things together or multiplying them with the operators like add and multiply so through operator of oil overloading in cotton you can use things like overloads of plus and minus and multiply or plus plus or even access things like square brackets or comparison operator it's like less than or greater than so the article goes into details on how the step worked under the hood as well as when to use it as well as some cases where you don't want to use it there was also an article on material design components and how to migrate your app to the latest greatest stuff so Nick route posted this article on the 1.

10 material design components library as well as lots of information on migrating so if you are currently using the old design support library the recommendation is to first migrate to MDC 1.


0 that will get you up in the android x world and then migrate to 1.


1 when you do migrate to sorry one dot one dot zero when you do migrate to that you'll get new features like dark theme fold material theming for things like color and typography as well as shapes and new widgets like the extended floating action button and the date picker and lots of accessibility improvements in bug fixes along the way there are tons of links in there to further resources not on just on migration but also just material design components in general and there's also a video version of the article embedded directly in that article so check out all of that and migrate your stuff one tap was an article posted by Sean McQuillan about the new one tap API for authenticating users it turns out that a lot of users sort of drop off of apps at the point where they are being asked to authenticate authenticate either to sign-in or to sign up for your services because sometimes that can be a confusing error-prone and frustrating experience so one tap aims to make that easier and smoother for the users and therefore retain more users in your application which is probably what you want so check out that article for information on that new API in the live data space Jose else Erika posted another couple of screencasts on it's it's actually a two-part video part one is one shot operations that shows how to use the live data co-routine builder which is an extension function or set of extension functions in KTX to save on a bunch of boilerplate code for doing the things you want to do anyway part two builds on that same capability and then shows how to use switch map for passing parameters with live and dynamic data that's going to be updated there was also a bunch of sample code posted first of all on the location side we've made a bunch of changes to location in the last few releases specifically around user privacy and sharing of user data and making it clear when the user's location is being accessed and when it is appropriate or inappropriate to do so and then developers need to react to these changes because let's do the right things for users right but sometimes it can be tricky to understand exactly what the right thing is or what the best practices are so Jeremy Walker has rewritten the code live that we have for Android location to have more detailed instructions on how to do this stuff and include best practices for the new policy changes that we've had over the last couple releases it also includes some support for the new Android 11 restrictions so if you're getting up to speed on Android 11 you'll want to pay attention to that and it covers the the most common use case which is actually getting the location when the you that when the app is in the foreground when the either the user is using the application or there's at least a foreground notification that gives it that visibility to the user that this is going on it is not best practice to actually retrieve location while the application is in the background there are some specific use cases where that is required so if your application actually does need that use case then Jeremy also updated the sample that we have to show the best practice for how to do that in the proper way in the accessibility area shailen Julie created a couple of code labs to show how to make your application more accessible so it turns out that if you use the standard widgets in the platform things like button then we generally do the right thing for developers right so a lot of accessibility capabilities just come for free it's when you're using custom widgets that you may run into problems but more importantly maybe you're running into problems and if you're not testing for it then maybe you're not even aware of it so there are two code labs one shows you how to identify the problems and then what the easy generally easy fixes are for those problems and then the second code lab is about building testing infrastructures so why go to the trouble of actually making your app accessible if you don't also building the automatic testing infrastructure that make sure that your app stays accessible over time with future changes so the next code lab talks about how to integrate accessibility testing into the existing expresso tests that you have and then finally we've had a couple of adb podcasts that have posted since the last now in Android first of all there was a DB 136 where it was just a casual chat between me and MoMA and tour and we talked about that is that a lot of developers have had over the last few weeks as we've sort of shifted to it working from home full-time thing so just chatting about you know the tools and the techniques that we personally are using and having a conversation because isn't that what we all should be doing in these work-from-home times and then finally ADB 137 just came out it's accessibility strangely enough and coincidentally also talking about how to make your apps and apps in general more accessible we talked to Cosette Sadiq and Sally un from the accessibility team about what their team does the frameworks that they work on for enabling accessibility and accessibility frameworks and functionality and the platform in general as well as what app developers can do to address the problems in their apps to to deal with what tends to be sort of a management or organizational issue in making sure that accessibility is a priority so check those out and check out everything else as usual all of this information is linked in the original article on medium so check out now in Android number 16 in Android developers publication on medium and if you liked the video go ahead and like and share and then subscribe to the Android developers channel on YouTube thanks you [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.