Android Jetpack

Also known as: Jetpack

On this page 7

Android Jetpack is a suite of libraries, tools and architectural guidance published by Google under the AndroidX namespace that helps developers write reliable, backward-compatible Android apps with less boilerplate code. In mobile app development, Jetpack is the default foundation for native Android projects: it supplies lifecycle-aware components, persistent storage, background scheduling, navigation and the Jetpack Compose UI toolkit as separately versioned modules.

Jetpack was announced in 2018 as the successor to the older Android Support Library. Its central idea is that most of the code an app depends on should ship with the app instead of the operating system, so that new features and fixes reach users regardless of which Android version their device runs.

How Jetpack libraries work outside the platform

Jetpack works by unbundling functionality from the Android framework and distributing it as libraries that are compiled into each app. The framework classes in android.* change only when a device receives an operating system update, which on many devices happens rarely or never. Classes in androidx.* are downloaded from the Google Maven repository at build time and packaged inside the APK or app bundle.

This design gives developers consistent behavior across API levels. A library such as Lifecycle or AppCompat contains compatibility code that uses a modern platform API where it exists and falls back to an equivalent implementation on older releases. The cost is a larger app binary, which tools such as R8 code shrinking reduce by removing unused classes.

Each artifact follows semantic versioning with explicit stability stages. The table below summarizes how a Jetpack release progresses and what each stage means for production use.

StageAPI stabilitySuitable for
AlphaAPIs may change or be removedExperiments and early feedback
BetaAPI surface frozen, bugs possibleTesting in preview builds
Release candidateFeature complete, final testingPre-release validation
StableBinary compatible within the major versionProduction apps
Jetpack release stages

Core component groups in Android Jetpack

Jetpack is usually described in four functional groups: foundation, architecture, behavior and UI. The grouping is a teaching aid rather than a technical boundary, because every library is an independent dependency that can be adopted on its own.

GroupExample librariesMain purpose
FoundationAppCompat, Core KTX, TestCompatibility layers and Kotlin extensions
ArchitectureViewModel, Room, WorkManager, PagingState, persistence and background work
BehaviorCameraX, Media3, Credential ManagerConsistent access to device features
UIJetpack Compose, Fragment, NavigationScreens, layout and in-app navigation
Representative libraries by group

The architecture components form the most influential part of the suite. ViewModel keeps screen state alive across configuration changes such as rotation, Lifecycle lets objects observe the start and stop events of activities, and Room provides a compile-time verified abstraction over SQLite. WorkManager schedules deferrable, guaranteed background work that survives process death and device reboots, while DataStore replaces SharedPreferences with an asynchronous, transactional key-value or typed store.

Dependency injection is supported through Hilt, which builds on Dagger and generates the component graph for Android classes. Together these libraries implement the recommended app architecture of separate UI, domain and data layers with a single source of truth for each type of data.

Jetpack compared with neighboring technologies

Jetpack is a native Android library collection, not a cross-platform framework, which places it differently from tools that share code across operating systems. The comparison clarifies where Jetpack ends and other App development technologies begin.

TechnologyScopeRelationship to Jetpack
Android Support LibraryLegacy compatibility librariesReplaced by AndroidX, frozen since version 28
Jetpack ComposeDeclarative UI toolkitPart of Jetpack, versioned through a BOM
Android StudioIntegrated development environmentTooling that creates and inspects Jetpack projects
Kotlin MultiplatformShared Kotlin code across platformsSeveral Jetpack libraries now publish multiplatform artifacts
FlutterCross-platform UI frameworkIndependent stack, uses its own rendering engine
Position of Jetpack among related tools

A frequent confusion concerns Jetpack versus Jetpack Compose. Compose is one member of the suite and covers only the UI layer, whereas Jetpack also includes persistence, scheduling, testing and camera libraries that work equally well with the classic View system. Since 2023, libraries such as Room, DataStore, Lifecycle and ViewModel have gained Kotlin Multiplatform support, allowing the same data layer to run on Android and iOS.

Adopting Jetpack in a project

Adoption starts with declaring individual artifacts in Gradle, ideally through a version catalog that keeps library versions in one file. Compose libraries are aligned with a bill of materials (BOM), which pins mutually compatible versions so that developers specify only one version number.

Projects still using the old support packages must perform a migration to AndroidX, which rewrites package names such as android.support.v7.app to androidx.appcompat.app. Android Studio automates most of this refactoring, and the Jetifier build option historically converted third-party binaries, although it is now rarely needed and slows builds.

The decision table below shows which Jetpack library typically fits a common requirement.

RequirementRecommended libraryReason
Keep state during rotationViewModelSurvives configuration changes
Store structured offline dataRoomVerified SQL queries and migrations
Upload logs when onlineWorkManagerConstraints and guaranteed execution
Save user preferencesDataStoreAsynchronous and consistent writes
Load long scrolling listsPagingIncremental loading with caching
Capture photos reliablyCameraXHides device-specific camera quirks
Choosing a library for a requirement

Limitations and common mistakes

Jetpack reduces fragmentation problems but does not eliminate them. Each library declares its own minimum SDK level, typically API 21 or 23 for current releases, and raising that floor can silently drop support for older devices when dependencies are updated.

  • Mixing incompatible versions of related artifacts causes runtime crashes; a BOM or version catalog prevents drift.
  • Shipping alpha libraries in production exposes apps to breaking API changes between releases.
  • Holding a Context or View inside a ViewModel creates memory leaks, because the ViewModel outlives the screen.
  • Running long tasks in WorkManager expecting exact timing fails, since the system batches work to save battery.
  • Skipping Room schema migrations leads to data loss or crashes when the database version increases.

Another trade-off is dependency weight. Each added library increases build time and method count, so mature teams adopt only the components that solve a concrete problem and verify the impact with APK size analysis.

Explained without jargon

Android Jetpack is a toolbox of ready-made parts that Google gives to people who build Android apps. Instead of writing the same tricky code again and again, such as saving data, remembering what was on the screen or running a task later, developers pick a tested part from the toolbox.

The parts travel inside each app, not inside the phone software. That means an app built today can behave the same way on a new phone and on a phone that is several years old. The key idea is simple: less repeated work and fewer surprises across different devices.

A typical use case

A small team builds a field inspection app for technicians who visit sites with weak mobile coverage. Inspectors fill in checklists and take photos, and the app must work offline and send everything to the server later.

The team stores checklists in Room, captures photos with CameraX, and keeps form state in a ViewModel so that rotating the tablet never erases an entry. A WorkManager job with a network constraint uploads pending reports whenever a connection returns, even after the device restarts. The interface is written in Jetpack Compose, and Hilt wires the layers together.

The result is an app that runs on devices from API level 26 upward with one codebase, and the team reports that no inspection data is lost when technicians lose signal in basements or rural areas.