Android JetPack: Navigation Architecture Component

Less boilerplate and easier control over your app navigation.

Pedro Batista
Deemaze Writing Wall

--

Last year, Google introduced Android Architecture Components, a set of components that aimed to reduce boilerplate code and accelerate development. Google IO 2018 added new components and mixed them with the existing support libraries to create what they now call Android Jetpack — a set of categorised unbundled libraries that can be added according to your application’s needs.

Navigation Architecture Component was introduced with Android Jetpack to facilitate the implementation of the navigation within your app and simultaneously enforce guidelines that will provide a consistent and predictable navigation to the end users. What are those guidelines, you ask?

  • Aside from one-time setups, an app should have a fixed starting screen when started from the launcher.
  • Android navigation stack should follow a LIFO structure. With the starting screen at bottom of the stack and the current on top.
  • The up button should never exit your app.
  • With the exception of the bottom…

--

--