Android Jetpack Flashcards

(15 cards)

1
Q

What are Android Jetpack Components?

A

A group of libraries in Android that helps developers build more robust apps, designed to make app development faster and more maintainable.

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

What are the categories of Android Jetpack Components?

A

Components are divided into 4 categories: UI, Behavior, Architecture, and Foundation.

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

What programming paradigm does Android Jetpack follow?

A

It follows a reactive programming paradigm, focusing on data streams and changes propagation.

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

What is the role of ViewModels in Android Jetpack?

A

ViewModels are responsible for the data model and associated logic, determining how data will be used.

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

What is LiveData in Android Jetpack?

A

LiveData is a data holder class that can be observed within a given lifecycle, notifying UI Controllers of changes in data.

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

What is the purpose of the ViewModel Component?

A

The ViewModel Component is responsible for loading, preparing, and managing UI-related data without directly interacting with UI Views.

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

How does ViewModel handle configuration changes?

A

ViewModels will not be destroyed if their owner is destroyed for a configuration change; a new instance of the owner will reconnect to the existing ViewModel.

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

What should ViewModels avoid storing?

A

ViewModels shouldn’t store objects with shorter lifecycles such as Activities, Fragments, or Views to prevent memory leaks.

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

What is Unidirectional Data Flow (UDF)?

A

UDF is a principle in modern app architecture that promotes a single direction of data flow throughout the app.

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

What is the recommended architecture for modern Android apps?

A

Modern architecture recommends a single Activity app with different screens loaded within the same Activity, promoting separation of concerns.

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

What is the purpose of onSaveInstanceState()?

A

onSaveInstanceState() is used for saving persistent UI data (UI state) upon onDestroy calls.

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

What are some components in the Architecture Category of Jetpack?

A

Components include Navigation, Paging, and WorkManager.

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

How can LiveData be used in XML layouts?

A

LiveData can be referred to directly in the Layout XML file, replacing the setter of the Observer in the Activity class.

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

What is the Gradle namespace for Jetpack components?

A

Jetpack components are under the androidx namespace in the Android library.

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

What is the significance of LifecycleOwner in Observers?

A

LifecycleOwner can handle lifecycle changes without implementing code inside the Activity/Fragment, notifying Observers only when active.

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