Android Navigation Flashcards

Study cards to better understand how android navigation works

1
Q

What are the 3 different types of navigation in Material, a design system created by Google

A

Forward (hierarchical)
Lateral
Reverse

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is lateral navigation

A

Moving between screens at the same level of hierarchy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the 3 ways lateral navigation can be implemented

A

Navigation drawer
Tabs
Bottom navigation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the 3 ways forward navigation is achieved

A
  • Moving sequentially through a flow
  • Moving from a parent screen to a child screen
  • Moving directly from one screen to another
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is reverse navigation and how is it achieved

A

Moving backwards through the screens
- Chronologically or hierarchically

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the 3 key components of the navigation component in jetpack

A
  1. Navigation graph
  2. NavHostFragment
  3. NavController
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a navigation graph and how is it used

A

XML resource file, contains information about destinations and actions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the NavHostFragment and where does it get added. Where does it get initiated

A

Provides an area for the navigation to occur. It gets added to the layout file where you want the navigation to occur.
It gets initiated in the activities code, along with a navController

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the NavController do

A

Handles navigation in the app and manages the back stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What do you need to do to use the navigation bar instead of the default action bar?

A

In the manifest file:
add
android:theme=”@style/Theme. NavigationJava.NoActionBar”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does the ViewModel do

A

Bridge between the data/business logic and the views
Survives config changes
Handles UI Logic
Gets and processes data from the Model
Observes changes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are two essential components that are needed to use Retrofit

A
  1. Retrofit interface (contract that defines how the app will interact with the API.
  2. The Retrofit client (creates the Retrofit interface static instance)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

After setting up the Retrofit instance and the Retrofit client what do you have to get the MainActivity to do?

A

Calls the retrofit client method for getInterface and then does the custom search

How well did you know this?
1
Not at all
2
3
4
5
Perfectly