Jetpack is a box of libraries that help developers to follow best practises in coding, and reduce boilerplate code. These libraries are available in Google Maven repository
Many jetpack libraries provide Android KTX extensions as shown below.
dependencies {
def lifecycle_version = “2.2.0”
implementation “androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version”
implementation “androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version”
…
}
With Jetpack you can get following advantages like:-
Jetpack libraries are been published in androidX namespace and we have to migrate our project, if we want to make use of Jetpack libraries.
There are many Jetpack libraries which are often used like
The best reason to use Jetpack libraries is to reduce complexities in terms of using libraries and making development easier for the developer as well as works as support libraries for android.
Below is a basic architecture components of android Jetpack.
Above image explains the basics of Jetpack components and there are many more components being added as Android gets updated everytime
Feel free to try this example and comment below.
Copyright ©TechOceanhub All Rights Reserved.