Now in Android: 12 – AndroidX, dynamic feature modules, articles, and more!


[Music] hi and welcome to another episode of now in Android this is episode number 12 which is really logical because last episode was episode number 2 so maybe explain what's going on this is actually episode 12 and episode 2 is actually episode 11 and episode 1 was episode 10 I had been naming the articles according to their episode number for a while and then I switched to dates and then we started the videos and they had their own numbers because there it all got very confusing so now the article says episode number 12 the video for that article says 12 the podcast also number 12 or there's a conspiracy theory that in fact we do have episodes 3 through 11 and video and podcast form but they were too dangerous to let out into the universe you can take your pick anyway on with the show so lots of things happen in Android of course in the last couple of weeks first of all Android X releases there were some stable releases that were basically bug fixes so fragments library the media 2 library navigation work manager there was also core 1.


0 had some interesting features and API changes in it you could check that out that is now in stable including notifications also making blend modes that were new in the Q release actually work on older releases through that magic compatibility thing and shortcut info and also window in sets and then finally view model savestate 2.

2 this is a huge new release with functionality of really not much basically this just changed the number so that it syncs up with the version numbers of the rest of lifecycle kind of like I'm updating the numbers of these episodes so that the article will sync with the video and podcast same thing there so 2 ty 2.

0 is the same as 1.


0 but with different numbers alright also in the Android X world we have hitting alpha for the first time as emoji 11.

0 has some new emojis from unicode emoji version 12 as well as 12.

1 so if you want those new emojis in your app this is a good way to get them and navigation 2.

30 this is interesting for a couple reasons one is there's a new artifact for navigation testing which is important obviously and also there's new dynamic features navigation so let me segue to the next section and we'll find out more about that so what is better than having a new API how about having an existing API that does new things so Wojtek call each in ski and Ben Weiss have been working on functionality for navigation that will handle dynamic feature modules so essentially you get to use the same navigation API where you navigate to things but some of those things can be parts of your code that are not actually loaded some of those parts of your application that are not yet installed so a little bit of background first of all application bundles Android app bundles is a new application bundling format that we came out with a few months ago and it is the way that Android developers should be bundling and releasing their code so instead of sending several API apks with different configure it configures up to the Play Store instead you send one app bundle up to the Play Store and then the Play Store can then divide this into the subsections the subsets of your functionality that is needed for any particular device and configuration that it needs to install that onto at the same time you can take advantage of a new feature the Play Store and Play libraries offer called dynamic feature modules where you can have that core module that gets installed initially that has all that core functionality that needs to be there when the app first launches and then you can have other additive things which are may be optional flows for the application they don't need to be there at first assets that aren't part of the initial flow whatever it is so you can make your initial download smaller and then download and install these other pieces as necessary so there is a play core library where you can handle the download and installation of these things manually yourself and you can certainly check out that API basically it's got callbacks I'd like to do this thing and then you could call back later and you can check the status of it and stuff like that or you could choose to use the new library that is in alpha form in navigation where you can tell your application to navigate to this thing and this thing maybe in one of these one of these feature modules and the navigation library the new API that's out there will handle the details of actually downloading and installing that for you if you want to check this out as I said it's in alpha form so maybe not ready for primetime for your application but they are looking for feedback on that so please do check it out there are Doc's for this as well as a sample that just got posted last week so the links for these as well as everything that I talked about in these shows are in the article so check out now in Android number 12 to check out the details for those there were a couple of interesting articles that you may want to take a look at one was called zero cost abstractions in Colin this is part of Florina Montanez cooze series on Kotlin vocabulary in this one she talks about inline classes which you can use for type safety without all of the overhead that you would think is associated with creating classes and also Android styling there's a new series from Nick butcher called Android styling and this first episode in the series is called themes versus styles and it goes over the differences between the two from the outside and frankly even from the inside they kind of look like the same thing right they both use style tags so what's the difference there they are pretty hugely different you use them in very different situation and Nick covers a lot of the differences in this article and there will be ongoing future articles that add to this series and add to our knowledge of themes and styles a lot of the stuff in the article but not all of it comes from a talk that Nick did with Chris Bane's at ATS so you should also check out that for a good background in themes and styles and finally we add a new podcast for ADB Android developers backstage we talked with Mike Mike naki ma bitch from Dropbox he is working on a library whose latest version is now in alpha stage he's working on this partially with the help of yeet Boyer and we talked to both of them on the podcast so there's this pattern that we refer to in the opinionated guide on architecture for Android called the repository pattern so it goes like this let's say you need to store your data on device maybe you want to use the room API in conjunction with the other architect Boden's but maybe you also need to occasionally retrieve data from the network would it be nice if your application didn't need to know about where that data was coming from it could just call a single API and then pieces underneath could determine whether it was coming from a local cache or coming from the network that's the repository pattern but we didn't implement the pattern that is not a library that we offer it's more of an idea of a library you can think of the store library as an implementation of that idea so they've taken a lot of of those architectural design ideas and put them into an API so that you can now ask this library for that data and the library will do the right thing after you configure in your code to actually reach the correct local and network pieces so that is currently in alpha again maybe not ready for a primetime but definitely worth checking out and also check out the podcast and that's all we have for this time if you like this video and other videos like it please like and share and subscribe to the Android developers Channel and I'll talk to you next time thanks [Music].

Leave A Reply

Your email address will not be published.