Tag Archives: Navigation component

MAD Skills Navigation Series 2 Wrap Up!

Posted by Murat Yener

It’s a wrap!! We’ve just finished the second series of Navigation on MAD Skills. In this series, we re-visited Chet’s DonutTracker app and added an important missing feature: the ability to track coffee.

With new functionality comes new responsibilities. While we added coffee tracking, we also improved the navigation experience, implemented conditional navigation, modularized the app and finally learned what is changing with multiple back stack support.

Episode 1: NavigationUI

As new destinations were added to the app,we used NavigationUI to offer a better navigation UI experience. NavigationUI helped us automatically integrate NavigationView and BottomNavigationView with the existing menu ids for destinations. You can check out the video linked below or if you prefer read the article here.

Episode 2: Conditional Navigation

We added coffee tracking functionality in the first episode but no matter whether users disable or enable the coffee tracker, they could still navigate to the CoffeeList fragment. In this episode, we fixed that by adding conditional navigation and directing our users to make a selection when they launch the app for the first time.

You can find the same content in article form here.

Episode 3: Nested Graphs and Include

In the third episode, we took a step back and organized the navigation graph by using nested graphs and using the include tag to import other graphs. While keeping our project more organized, this also allowed us to modularize the app and see how navigation works with modules. Check out the article or the video below.

Episode 4: Feature Modules

In the fourth episode, we took the app a step further and converted the coffee module to a feature module. With this change, the coffee tracking feature will only be downloaded and installed for users who enabled this feature. Dynamic features allowed us to modularize the app to save network and storage for the user. To learn more, check out the video linked below or if you prefer read the article here.

Episode 5: Multiple Back Stacks

In this episode, we covered a highly requested feature, multiple back stack support for Navigation. To support multiple back stacks, all you need to do is to update your navigation and fragment dependencies. You can observe multiple back stack behavior with NavigationView and BottomNavigationView instantly without any code change!

You can also find the same content in article form here.

Episode 6: Live Q&A

Finally, we wrapped up the second series of Navigation with a live Q&A session where we answered your questions. If you missed the Q&A, make sure to check out the recording below.

Sample Apps

Donut and Coffee Tracker

The application used for the first 4 episodes in the series is the DonutTracker app which Chet built during the first Navigation series on MAD Skills. You can follow the progress in each episode by checking out the starter and solution code from this repo.

Navigation Advanced Sample

This project is used to demonstrate Multiple back stack support in Navigation. Before Navigation version 2.4.0-alpha01, this project offered NavigationExtensions to mimic the multiple back stack behavior. You can check out the solution code with updated dependencies and NavigationExtensions removed in this repo.

This brings an end to the second Navigation series but the MAD series will continue with another exciting topic! Make sure you stay tuned for more Android MADness!

MAD Skills Navigation Series 2 Wrap Up!

Posted by Murat Yener

It’s a wrap!! We’ve just finished the second series of Navigation on MAD Skills. In this series, we re-visited Chet’s DonutTracker app and added an important missing feature: the ability to track coffee.

With new functionality comes new responsibilities. While we added coffee tracking, we also improved the navigation experience, implemented conditional navigation, modularized the app and finally learned what is changing with multiple back stack support.

Episode 1: NavigationUI

As new destinations were added to the app,we used NavigationUI to offer a better navigation UI experience. NavigationUI helped us automatically integrate NavigationView and BottomNavigationView with the existing menu ids for destinations. You can check out the video linked below or if you prefer read the article here.

Episode 2: Conditional Navigation

We added coffee tracking functionality in the first episode but no matter whether users disable or enable the coffee tracker, they could still navigate to the CoffeeList fragment. In this episode, we fixed that by adding conditional navigation and directing our users to make a selection when they launch the app for the first time.

You can find the same content in article form here.

Episode 3: Nested Graphs and Include

In the third episode, we took a step back and organized the navigation graph by using nested graphs and using the include tag to import other graphs. While keeping our project more organized, this also allowed us to modularize the app and see how navigation works with modules. Check out the article or the video below.

Episode 4: Feature Modules

In the fourth episode, we took the app a step further and converted the coffee module to a feature module. With this change, the coffee tracking feature will only be downloaded and installed for users who enabled this feature. Dynamic features allowed us to modularize the app to save network and storage for the user. To learn more, check out the video linked below or if you prefer read the article here.

Episode 5: Multiple Back Stacks

In this episode, we covered a highly requested feature, multiple back stack support for Navigation. To support multiple back stacks, all you need to do is to update your navigation and fragment dependencies. You can observe multiple back stack behavior with NavigationView and BottomNavigationView instantly without any code change!

You can also find the same content in article form here.

Episode 6: Live Q&A

Finally, we wrapped up the second series of Navigation with a live Q&A session where we answered your questions. If you missed the Q&A, make sure to check out the recording below.

Sample Apps

Donut and Coffee Tracker

The application used for the first 4 episodes in the series is the DonutTracker app which Chet built during the first Navigation series on MAD Skills. You can follow the progress in each episode by checking out the starter and solution code from this repo.

Navigation Advanced Sample

This project is used to demonstrate Multiple back stack support in Navigation. Before Navigation version 2.4.0-alpha01, this project offered NavigationExtensions to mimic the multiple back stack behavior. You can check out the solution code with updated dependencies and NavigationExtensions removed in this repo.

This brings an end to the second Navigation series but the MAD series will continue with another exciting topic! Make sure you stay tuned for more Android MADness!

MAD Skills Navigation Wrap-Up

Posted by Chet Haase

MAD Skills navigation illustration of mobile and desktop with Android logo

It’s a Wrap!

We’ve just finished the first series in the MAD Skills series of videos and articles on Modern Android Development. This time, the topic was Navigation component, the API and tool that helps you create and edit navigation paths through your application.

The great thing about videos and articles is that, unlike performance art, they tend to stick around for later enjoyment. So if you haven’t had a chance to see these yet, check out the links below to see what we covered. Except for the Q&A episode at the end, each episode has essentially identical content in the video and article version, so use whichever format you prefer for content consumption.

Episode 1: Overview

The first episode provides a quick, high-level overview of Navigation Component, including how to create a new application with navigation capability (using Android Studio’s handy application templates), details on the containment hierarchy of a navigation-enabled UI, and an explanation of some of the major APIs and pieces involved in making Navigation Component work.

Or in article form: https://medium.com/androiddevelopers/navigation-component-an-overview-4697a208c2b5

Episode 2: Dialog Destinations

Episode 2 explores how to use the API to navigate to dialog destinations. Most navigation takes place between different fragment destinations, which are swapped out inside of the NavHostFragment object in the UI. But it is also possible to navigate to external destinations, including dialogs, which exist outside of the NavHostFragment.

Or in article form: https://medium.com/androiddevelopers/navigation-component-dialog-destinations-bfeb8b022759

Episode 3: SafeArgs

This episode covers SafeArgs, the facility provided by Navigation component for easily passing data between destinations.

Or in article form: https://medium.com/androiddevelopers/navigating-with-safeargs-bf26c17b1269

Episode 4: Deep Links

This episode is on Deep Links, the facility provided by Navigation component for helping the user get to deeper parts of your application from UI outside the application.

Or in article form: https://medium.com/androiddevelopers/navigating-with-deep-links-910a4a6588c

Episode 5: Live Q&A

Finally, to wrap up the series (as we plan to do for future series), I hosted a Q&A session with Ian Lake. Ian fielded questions from you on Twitter and YouTube, and we discussed everything from feature requests like multiple backstacks (spoiler: it’s in the works!) to Navigation support for Jetpack Compose (spoiler: the first version of this was just released!) to other questions people had about navigation, fragments, Up-vs-Back, saving state, and other topics. It was pretty fun — more like a podcast with cameras than a Q&A.

(There is no article for this one; enjoy the video above)

Sample App: DonutTracker

The application used for most of the episodes above is DonutTracker, an app that you can use for tracking important data about donuts you enjoy (or don’t). Or you can just use it for checking out the implementation details of these Navigation features; your choice.