fbpx

Guessing Game – Introduction

Reading Time: < 1 minute

In this tutorial, we are going to build up a simple guessing game. First, a short introduction to the game. The essence of the game is to figure out a hidden, randomly generated number. This number is between 1 and 10. We have endless possibilities to try.

From Android development side, we are going to use in this tutorial 2 Jetpack libraries, which are the Data Binding and the Navigaion Component. Then, we will use the MVVM design pattern, together with LiveData and ViewModel.

In our app, we will have only one Activity. This activity will hold a fragment, where we will define the view of the game and from this fragment we can open a bottom sheet dialog also.

Read moreGuessing Game – Introduction

Follow and like us:

Navigation component – Bottom navigation bar

Reading Time: 6 minutes

In this chapter of the Jetpack Navigation Component tutorial we are going to talk about how we can use bottom navigation bar to navigate in our app.

This chapter will cover how to add a bottom navigation bar to the app. It means, we will create the menu items, and use the defined destinations, which are already available in the navigation graph.

Then, as an extra, we will check how we can open a fragment, where we don’t need the bottom navigation.

So let’s start coding. ๐Ÿ˜Ž

Read moreNavigation component – Bottom navigation bar

Follow and like us:

Navigation component – Managing back stack

Reading Time: 5 minutes

In this chapter of the Navigation Component Android tutorial we are going to learn how can we manage the back-stack in our app. First we are going to add the SplashFragment. After that, we will check how we can handle it in the back stack. Then we will remove Fragment_4 from the back stack. So, when we press the back button, then the Fragment_1 pops up.

This tutoiral is about how to use the JetPack Navigation Component to handle the fragment’s, activity’s navigations, argument and actions in our app centralized. The sample app contains 6 fragments, the main activity and a Navigation Drawer.

In the very last chapter we have learned how we can handle dialog and how we can get back from it the result.

For this chapter we have prepared a starter project. This project contains already the SplashScreen, which will be firstly visible for the user, when they open the app.

Read moreNavigation component – Managing back stack

Follow and like us:

Navigation component – Dialog fragment

Reading Time: 6 minutes

In this chapter of the Navigation Component Android tutorial, we are going to learn how to open a dialog fragment and how to get back the result of the user’s action.

This tutoiral is about how to use the JetPack Navigation Component to handle centralized the fragment and activity navigations, arguments and actions in our app. The sample app contains 5 fragments, the main activity and a Navigation Drawer.

In the very last chapter we have learned about, how we can save the state of the fragment using a ViewModel.

For this chapter we have prepared a start project. This project contains already the RecyclerView and the new fragment, which will be the dialog fragment. Using this dialog we will add new items to the RecyclerView.

 

Read moreNavigation component – Dialog fragment

Follow and like us:

Navigation component – Save state using ViewModel

Reading Time: 3 minutes

In this chapter of the Navigation Component Android tutorial we are going to learn how to save the state of the fragment using ViewModel.

This tutorial is about how to use the JetPack Navigation Component to handle the fragment and activity navigations, argument and actions in our app centralized. The sample app contains 5 fragments, the main activity and a Navigation Drawer.

In the very last chapter we have added the Navigation Drawer and we implemented the top-level fragments as well. In this chapter we are going to learn how to save the state of the fragments using a ViewModel.

We are going to save the content of an EditText in a variable, which is declared in a ViewModel. Then, if we navigate back to this fragment, the content should be still there.

So let’s start coding. ๐Ÿ˜Ž

Read moreNavigation component – Save state using ViewModel

Follow and like us:

Navigation component – Navigation drawer

Reading Time: 5 minutes
In the very last chapter (Passing data) of the Navigation component tutorial, we were talking about how we can pass data between fragments, when we click on a button. In this chapter we are going to talk about how we can use Navigation component together with Navigation Drawer.

NavigationView (Navigation Drawer) is an easy way to display a navigation menu from a menu resource.

This is most commonly used in conjunction with DrawerLayout to implement Material navigation drawers. Navigation drawers are modal elevated dialogs that come from the start/left side, used to display in-app navigation links.

Read moreNavigation component – Navigation drawer

Follow and like us:

stay informed!

Subscribe to receive exclusive content and notifications