An Introduction to Android Jetpack
Date
May 16, 24
Reading Time
4 minutes
Category
Technology
- What is Android Jetpack?
- These software components (libraries, tools) helps in:
- All the major problems that have been solved by the Android Jetpack's software components are:
- Android Jetpack Components
- Foundation Components
- Architecture Components
- Behavior Components
- UI Components
Table of content
What is Android Jetpack?
Android Jetpack is a collection of libraries, tools which help us in building great Android apps. Architecture, UI, Behavior, and Foundation are four categories for using Jetpack.
Architecture Components could be classified as follows: Room, WorkManager, Lifecycle, Navigation, Paging, Data Binding, ViewModel, and LiveData.
These software components (libraries, tools) helps in:
- Following the best practices and writing the boilerplate code.
- Making complex things very simple.
All the major problems that have been solved by the Android Jetpack's software components are:
- Managing activity lifecycles.
- Surviving configuration changes.
- Preventing memory leaks.
Android Jetpack Components
Android Jetpack components are a collection of libraries, tools that are individually adoptable and built to work together while taking advantage of Kotlin language features that make us more productive.
These are the four components:
- Foundation Components
- Architecture Components
- Behavior Components
- UI Components
Foundation Components
Foundation components provide backward compatibility, testing and Kotlin language support.
Foundation components are as follows:
- App Compat: Degrade gracefully on older versions of Android with material design user interface implementation support.
URL: https://developer.android.com/jetpack/androidx/releases/appcompat
- Android KTX: Set of Kotlin extensions to write more concise, idiomatic Kotlin code.
- Multidex: Provide support for multiple dex files for apps.
URL: https://developer.android.com/studio/build/multidex
- Test: A testing framework for unit and runtime UI tests in Android.
URL: https://developer.android.com/studio/test
Architecture Components
The architecture components help us in building robust Apps, testable Apps, maintainable Apps
Architecture components are as follows:
- Data Binding: Declaratively bind UI elements in our layout to data sources of our app.
- Lifecycles: Manages activity and fragment life cycles of our app.
- LiveData: Notify views of any database changes.
- Navigation: Handle everything needed for in-app navigation.
- Paging: Gradually load information on demand from your data source.
- Room: Fluent SQLite database access.
- ViewModel: Manage UI-related data in a lifecycle conscious way.
- WorkManager: Manage all background jobs in Android with the circumstances we choose.
Behavior Components
The behavior components help in the integration with standard Android services like notifications, permissions, sharing, assistant
Behavior components are as follows:
- Download Manager: Schedule and manage large downloads in the background with auto-retry support.
- Media & playback: Backwards compatible APIs for media playback and routing (including Google Cast).
- Notifications: Provides a backward-compatible notification API with Wear and Auto support.
- Permissions: Compatibility APIs for checking and requesting permissions in-app.
- Preferences: Create interactive settings screens for users to configure.
- Sharing: Provides a share action suitable for an app’s action bar.
- Slices: Create flexible UI elements that can display app data outside the app and can be extended all the way back to Android 4.4.
UI Components
The UI components provide widgets and helpers to make your app not only easy but delightful to use.
UI components are as follows:
- Animation and transitions: Move widgets and transition between screens.
- Auto: Components to develop Android Auto apps.
- Emoji: Enable updated emoji font on older platforms.
- Fragment: A basic unit of composable UI.
- Layout: Layout widgets with different algorithms.
- Palette: Pull useful information from color palettes.
- TV: Components to develop Android TV apps.
- Wear: Components to develop Wear apps.