For the More Curious: Jetpack, AndroidX, and Architecture Components

The androidx.lifecycle library containing ViewModel is part of Android Jetpack Components. Android Jetpack Components, called Jetpack for short, is a set of libraries created by Google to make various aspects of Android development easier. You can see a list of the Jetpack libraries at developer.android.com/​jetpack. You can include any of these libraries in your project by adding the corresponding dependency to your app/build.gradle file, as you did in this chapter.

Each Jetpack library is located in a package that starts with androidx. For this reason, you will sometimes hear the terms AndroidX and Jetpack used interchangeably.

Jetpack libraries make up the backbone of most modern Android apps. When you generated GeoQuiz, Android Studio included a few of them by default. As you continue in this book, you will encounter several Jetpack libraries, such as Fragments (Chapter 9), Room (Chapter 12), and WorkManager (Chapter 22).

Some of the Jetpack components are entirely new. Others have been around for a while but were previously lumped into a handful of much larger libraries collectively called the Support Library. If you hear or see anything about the Support Library, know that you should now use the Jetpack (AndroidX) version of that library instead.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset