‫Hello, my friends.
‫In this video we will start building an app that uses and implement the navigation architecture component.
‫So open Android studio, Click new project, Select Empty Activity and I will name it as NAV app.
‫Select Kotlin.
‫Click finish to start building this application.
‫Now we will add the dependency for the navigation.
‫I will go to developer.android.com slash jetpack slash android slash releases, slash navigation, and
‫here I will use.
‫This dependency, so I will start adding the dependency in the granule.
‫I will start defining the variable for the nav version.
‫I will name it as nav version.
‫And if you're using Java language, you can implement this.
‫If you're using the Kotlin in this case.
‫I will use this to dependencies.
‫Okay.
‫So this is for NAV or navigation library.
‫Okay.
‫Now.
‫I will add something called safe args.
‫Safe args are used to pass data between between activities and fragments, so use safe arcs to pass
‫data with type safety.
‫Later on we will talk about safe args deeply, but I want from you to concentrate on how to add the
‫safe args to our project here.
‫So we're going to add the safe ARG.
‫The in the bold script.
‫So I will copy this.
‫I will go to the build and the project module.
‫You can't see.
‫This, I will paste the whole.
‫Code.
‫And this is for the classpath though.
‫So if you don't have the build scripts in your build.gradle, you can use this all code.
‫Then we will check for here to change it to Dev and everything will work fine.
‫I will change the cut the plugins under the build scripts and I will add here the task clean.
‫And I will pass type, which is delete.
‫And here I will add delete route project dot build dir.
‫Okay.
‫This is for the uh, for the gradle.
‫If you don't have the complete file, if you have this scripts.
‫So they are good and you can only add the class path.
‫Okay.
‫But in case you don't have anything and you're updated to latest build.gradle and gradle builds so you
‫will get only the plugins in your file.
‫You need to add these manually, so click on sync now.
‫Then I need to add a plugin here and if you are using Kotlin alternatively to generate Kotlin code suitable
‫for Kotlin only models.
‫If you are not using Java, you use Kotlin like in this way or in this case I go to here.
‫And the your app or models build.gradle so app.
‫Module.
‫Here.
‫I will go up and add the plugin.
‫I'd.
‫Like this.
‫And I need to add here for the.
‫All projects.
‫I need to add repositories and I need to add Google and this repository.
‫Okay, click on sync now.
‫And if we check that the repository Google was added by the file, I go to Settings dot Gradle and you
‫can see that Google is added so we can remove all projects.
‫Okay, so I'm showing you how the new gradle files are working.
‫Okay, click try now.
‫And everything will work fine.
‫This way we've we've added the navigation library and we've added the save args to our project.