This document provides a list of frequently used dependencies for Android app development, including setup instructions and usage notes.
Room is a persistence library that provides an abstraction layer over SQLite to allow for more robust database access while harnessing the full power of SQLite.
val room_version = "2.6.1"
// Room runtime
implementation("androidx.room:room-runtime:$room_version")
// Annotation Processor for Room (Java)
annotationProcessor("androidx.room:room-compiler:$room_version")
// Kotlin Annotation Processing Tool (kapt)
kapt("androidx.room:room-compiler:$room_version")
// Kotlin Symbol Processing (KSP)
ksp("androidx.room:room-compiler:$room_version")
// Optional - Paging 3 Integration
implementation("androidx.room:room-paging:$room_version")
- Room Paging: Use the paging integration if you're working with large datasets and need efficient on-demand loading.
- Choose between
kapt
orksp
based on your project's requirements.
KTX libraries provide Kotlin extensions for Android libraries to simplify development and improve code readability.
implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.4")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.8.4")
implementation("androidx.room:room-ktx:2.6.1")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.4")
implementation("com.google.android.play:core-ktx:1.8.1")
- Lifecycle KTX: Provides Kotlin-friendly LiveData, ViewModel, and runtime classes for managing UI-related data in a lifecycle-conscious way.
AndroidX Navigation component simplifies navigation between fragments, activities, and other composables.
implementation("androidx.navigation:navigation-runtime-ktx:2.7.7")
implementation("androidx.navigation:navigation-fragment-ktx:2.7.7")
implementation("androidx.navigation:navigation-ui-ktx:2.7.7")
- Navigation KTX: Leverage the power of Kotlin for concise and idiomatic navigation code.
OkHttp is an HTTP client for Android that supports HTTP/2 and features a robust connection-pooling mechanism.
implementation("com.squareup.okhttp3:okhttp-bom:4.12.0")
implementation(platform("com.squareup.okhttp3:okhttp-bom:4.12.0"))
implementation("com.squareup.okhttp3:okhttp")
implementation("com.squareup.okhttp3:logging-interceptor")
- BOM: The Bill of Materials (BOM) ensures all OkHttp components use the same version, avoiding compatibility issues.
Retrofit is a type-safe HTTP client for Android and Java, developed by Square.
PICASSO :
implementation ("com.squareup.picasso:picasso:2.8")
GLIDE :
implementation 'com.github.bumptech.glide:glide:4.16.0'
VOLLEY :
implementation ("com.github.bumptech.glide:volley-integration:4.14.2")
CircularImageView :
implementation ("de.hdodenhof:circleimageview:3.1.0")
val retrofit_version = "2.11.0"
implementation("com.squareup.retrofit2:retrofit:$retrofit_version")
- Combine Retrofit with OkHttp for network operations, making it easy to handle API requests and responses.
Hilt is a dependency injection library for Android that reduces the boilerplate code involved in using Dagger in your app.
id("com.google.dagger.hilt.android") version "2.44" apply false
id("kotlin-kapt")
id("com.google.dagger.hilt.android")
implementation("com.google.dagger:hilt-android:2.44")
kapt("com.google.dagger:hilt-android-compiler:2.44")
- Hilt: Simplifies dependency injection in Android apps, especially when working with ViewModels, WorkManager, and other Android components.
Pagination library helps you load data gradually and efficiently, perfect for handling large datasets.
val paging_version = "3.3.2"
implementation("androidx.paging:paging-runtime:$paging_version")
// For testing without Android dependencies
testImplementation("androidx.paging:paging-common:$paging_version")
// Optional - Jetpack Compose integration
implementation("androidx.paging:paging-compose:3.3.2")
- Paging: Ideal for implementing infinite scrolling or on-demand data loading patterns in RecyclerViews or Compose-based lists.
- Ensure that your project’s Gradle files are set up to use Kotlin DSL.
- You can too refer to Official Docs as well for in-depth reference or dependencies update.