Android Navigation Architecture Component — a glimpse of future?
This year, in the annual Google I/O dev conference, Google announced Navigation for the Android Architecture Components. This is a tool for Android developers to define in-app navigation on metadata level.
If you want to dig into the navigation architecture component the best starting point is the Google I/O video. After that I’d recommend reading this excellent overview and hands on blog post from Maria Neumayer. And then there’s, of course, the official Google documentation to read afterwards.
However, technical details or implementing the navigation is not what I wanted to write about today.
In-app navigation has long been one of the biggest pain points in Android apps. I’ve written about Android back navigation being unpredictable and inconsistent already years ago.
Can we read into Android’s future based on what we saw in the Android P preview and in the new navigation component?
A glimpse into Android’s back-buttonless future?
Disclaimer: The rest of this article is speculation and wishful thinking based on publicly available information. I have no information about Google’s plans and my speculation might be a complete miss.
Android P beta introduced new gesture-based navigation replacing the need for multitasking button with gestures.
We also see the back button becoming dynamic. It only shows up when there’s something to navigate to.
Like mentioned above, one of my pet peeves in Android is that the back button behaviour is completely blind. Just by looking at the button you cannot even begin to guess what happens when you press it. The stock launcher’s dynamic back is the first example of predictable behaviour (if you don’t count the keyboard dismiss mode).
I keep hearing hearing an excuse from developers time to time when I complain about the Android back button explaining that the Android back button is completely deterministic; it always goes back to the previous screen. Or that it simply pops the backstack.
Neither is true. The back button has multiple functions that don’t lead into precious screen like dismissing popups, apps that build artificial backstacks when deep linked or in browsers it becomes a browser back to just to mention few.
In running apps, back button behaviour is technically impossible to predict by the platform. Developers can mess with the back behaviour by overriding a function in their activities:
But what if apps would use single-activity navigation? Or what if we would use metadata to define navigation, both directions?
The new Navigation Architecture Component takes full control over app navigation. It handles navigating to new screens as well as back navigation, even if in special cases you need back button to navigate to some other screen than just the previous one:
By comparison, iOS back behaviour is much more predictable than Android’s. In the iOS world the developers have always been responsible of delivering understandable navigation forwards and backwards. Apps often tell exactly where the top-left-corner button will take you.
However, in the iOS world back only worked inside apps for a long time. Apps opening other apps and deep linking wasn’t as central concept as it was on Android from the day one. Apple has had to implement a nasty hack to navigate back to other apps:
Android in-app navigation is currently painful to implement and not optimal UX. The new Navigation component is for sure worth looking at and worth seriously considering using in new projects. I’m very happy to see Google trying to improve this part of our toolbox.
I think this new component might be a bigger deal than it initially looks like on the surface. We might soon start to see solutions to the Android back navigation surface.It might be removing the back button completely or simply making it more expressive and easier for users to understand what the button will do (before pressing it). These solutions, if they become reality, will almost certainly rely on this new component. If this happens you will want your app to be part of the solution.
Menu button — gone. Multitasking button — gone. Home button — gone, kind of. I think the back button should start looking around nervously.