Tag Archives: navigation

Android Jetpack Navigation Stable Release

Posted by Ian Lake, Software Engineering Lead & Jisha Abubaker, Product Manager

Cohesive tooling and guidance for implementing predictable in-app navigation

Today we're happy to announce the stable release of the Android Jetpack Navigation component.

The Jetpack Navigation component's suite of libraries, tooling and guidance provides a robust, complete navigation framework, freeing you from the challenges of implementing navigation yourself and giving you certainty that all edge cases are handled correctly.

With the Jetpack Navigation component you can:

  • Handle basic user actions like Up & Back buttons so that they work consistently across devices and screens.
  • Allow users to land on any part of your app via deep links and build consistent and predictable navigation within your app.
  • Improve type safety of arguments passed from one screen to another, decreasing the chances of runtime crashes as users navigate in your app.
  • Add navigation experiences like navigation drawers and bottom navigation consistent with the Material Design guidelines.
  • Visualize and manipulate your navigation flows easily with the Navigation Editor in Android Studio 3.3

The Jetpack Navigation component adheres to the Principles of Navigation, providing consistent and predictable navigation no matter how simple or complex your app may be.

Simplify navigation code with Jetpack Navigation Libraries

The Jetpack Navigation component provides a framework for in-app navigation that makes it possible to abstract away the implementation details, keeping your app code free of navigation boilerplate.

To get started with the Jetpack Navigation component in your project, add the Navigation artifacts available on Google's Maven repository in Java or Kotlin to your app's build.gradle file:

 dependencies {
    def nav_version = 2.0.0

    // Java
    implementation "androidx.navigation:navigation-fragment:$nav_version"
    implementation "androidx.navigation:navigation-ui:$nav_version"

    // Kotlin KTX 
    implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
    implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
  }

Note: If you have not yet migrated to androidx.*, the Jetpack Navigation stable component libraries are also available as android.arch.* artifacts in version 1.0.0.

navigation-runtime : This core library powers the navigation graph, which provides the structure of your in-app navigation: the screens or destinations that make up your app and the actions that link them. You can control how you navigate to destinations with a simple navigate() call. These destinations may be fragments, activities or custom destinations.

navigation-fragment: This library builds upon navigation-runtime and provides out-of-the-box support for fragments as destinations. With this library, fragment transactions are now handled for you automatically.

navigation-ui: This library allows you to easily add navigation drawers, menus and bottom navigation to your app consistent with the Material Design guidelines.

Each of these libraries provide an Android KTX artifact with the -ktx suffix that builds upon the Java API, taking advantage of Kotlin-specific language features.

Tools to help you build predictable navigation workflows

Available in Android Studio 3.3 and above, the Navigation Editor lets you visually create your navigation graph , allowing you to manage user journeys within your app.

With integration into the manifest merger tool, Android Studio can automatically generate the intent filters necessary to enable deep linking to a specific screen in your app. With this feature, you can associate URLs with any screen of your app by simply setting an attribute on the navigation destination.

Navigation often requires passing data from one screen to another. For example, your list screen may pass an item ID to a details screen. Many of the runtime exceptions during navigation have been attributed to a lack of type safety guarantees as you pass arguments. These exceptions are hard to replicate and debug. Learn how you can provide compile time type safety with the Safe Args Gradle Plugin.

Guidance to get it right on the first try

Check out our brand new set of developer guides that encompass best practices to help you implement navigation correctly:

What developers say

Here's what Emery Coxe, Android Lead @ HomeAway, has to say about the Jetpack Navigation component :

"The Navigation library is well-designed and fully configurable, allowing us to integrate the library according to our specific needs.

With the Navigation Library, we refactored our legacy navigation drawer to support a dynamic, runtime-based configuration using custom views. It allowed us to add / remove new screens to the top-level experience of our app without creating any interdependencies between discreetly packaged modules.

We were also able to get rid of all anti-patterns in our app around top-level navigation, removing explicit casts and hardcoded assumptions to instead rely directly on Navigation. This library is a fundamental component of modern Android development, and we intend to adopt it more broadly across our app moving forward.

Get started

Check out the migration guide and the developer guide to learn how you can get started using the Jetpack Navigation component in your app. We also offer a hands-on codelab and a sample app.

Also check out Google's Digital Wellbeing to see another real-world example of in-app navigation using the Android Jetpack Navigation component.

Feedback

Please continue to tell us about your experience with the Navigation component. If you have specific feedback on features or if you run into any issues, please file a bug via one of the following links:

Kick off your summer travels with these new Google Maps features

The weather’s heating up, kids are out of school, and that means only one thing: summer’s officially here. Summer brings weekend road trips, faraway escapes and all kinds of getaways in between. And with the latest update to Google Maps, we're introducing two new features to get you where you’re going and help you remember your travels in a brand new way.

Road trip warriors can now get multi-stop directions in Google Maps on Android (coming soon to iOS). Just open the app, enter a destination, tap the corner menu, and then click “Add a stop”. To rearrange the order of your stops, tap and hold the three dot menu to the left of “Add stop” and drag it to the position you want – you can even search for types of places like gas stations or restaurants like you normally would. Once you’ve added all your stops, tap “Done” and your multi-stop route is complete. When you enter navigation mode you’ll have the same seamless driving experience you’re used to, whether you’re going from errand to errand or hitting scenic spots along Route 66.


A lot of the fun of traveling is the memories created while exploring new places with friends, family or even solo. Pictures are a traditional way to remember those moments, but now Your Timeline users on Android can preserve their travel memories and info in a new way. Google Maps users with Location History enabled can open Your Timeline, select a date from their recent vacation or everyday life and add notes to help remember what they did that day—or save important notes for later.



No matter where your travels take you this summer and beyond, these new Google Maps features will get you there and help keep track of all the memories you make along the way.

Posted by Liz Davidoff, Communications Manager, Google Maps


Source: Google LatLong


Maps Minutes Hack #9: Get home quickly and safely on New Year’s Eve

Part of our series on how to save time this holiday season with Google Maps.

Whether you’re heading to a friend’s house for a cozy gathering, going to watch the ball drop in Times Square or attending an extravagant masquerade ball, the last thing you want to worry about on New Year’s Eve is driving.

With the Google Maps app, you can get where you’re going without ever getting behind the wheel. Earlier this year we launched a new feature that allows you to see various transportation options and compare travel times–all on one screen.

Once you enter your destination in the Google Maps app, you’ll see four options to get there: driving, walking, biking or transit (bus/train). You can quickly compare ETAs and switch between the transportation modes for more details and up-to-date information for each option.



If you’re heading to a casual celebration not so far from home, walking or public transit might be your best option. The Google Maps app will give your walk time ETA along with a few transit route options with real-time schedules, updates and fares.



Google Maps can also help you grab an Uber, if arriving by bus or train isn’t your holiday style. You can see the estimated trip duration, pickup time and estimated cost once you scroll down to the bottom of the app's transit option screen.

Stay safe with Maps Minutes Hacks and enjoy your New Year’s celebrations wherever they take you.

Posted by Dai Pham, Head of Geo and Google Maps Marketing

Source: Google LatLong


Maps Minutes Hack #8: Set your home and work addresses for easy navigation

Part of our series on how to save time this holiday season with Google Maps.

It’s crunch time. There are holiday parties to attend and last-minute gifts to be bought and wrapped. When the holidays are only days away even the small things can make a difference. So here’s another helpful trick for how you can save a few extra minutes every time you use Google Maps for directions or navigation.

You can save your home and work addresses in Google Maps, and then select “home” or “work” rather than typing the locations every single time. Just go to “your places” on the side menu and you’ll see “home” and “work” under “labeled places”. Enter the address for each and next time you’re navigating to or from home or work, you can get your directions a little quicker and easier than before.



Every minute matters. Save more every day with Maps Minutes Hacks. Next up: how to get home fast and safe on New Year’s Eve.

Posted by Olga Suvorova, Product Marketing Manager, Google Maps

Source: Google LatLong


Maps Minutes Hack #7: No signal, no problem. Navigate your holiday travels with Google Maps offline

Part of our series on how to save time this holiday season with Google Maps.

This time of year, millions take a road trip home for the holidays or adventure to faraway places all over the world. Whether you’re traveling abroad or rediscovering your own hometown, it helps to be able to navigate quickly and easily, even with limited mobile data or a spotty internet connection.

Google Maps offline, now available on iOS and Android, can help you get the most out of your holiday travels. You can browse pre-downloaded map areas, search for places, get directions and turn-by-turn navigation–all offline. Because exploring the world shouldn’t require a data connection or excessive roaming charges.

To navigate offline, simply open the Google Maps app and save any area on the map while you have a connection. Search for a place like San Francisco or Mexico City, open the place card and tap the download button. You can adjust the size of the map area you want to download and name it. Once downloaded, that area will be automatically added to your Offline areas in the side menu.



Once you’ve saved a map area, you can search for places and get directions offline. Looking for that famous art gallery or a neighborhood watering hole? You can check out addresses, opening hours, phone numbers and even navigate there–all without internet access.

To explore and navigate the world offline, install the Google Maps app on your iPhone before your holiday journey, or open it on Android along the way.

Get the most of your holiday time with Maps Minutes Hacks. Next up: how to get around faster and safer.

Posted by Dai Pham, Head of Geo and Google Maps Marketing

Source: Google LatLong