β οΈ This project is built purely for learning purposes. It is a hands-on Android application developed to practice and explore modern Android development concepts, architecture patterns, and Jetpack libraries.
ReadStack is an Android app that allows users to search for books using the Google Books API, save their favorite books to a personal library, view detailed book information, and share favorite quotes as images. The project serves as a practical playground for learning and implementing modern Android development best practices.
- π Book Search β Search books by title, author, or keyword using the Google Books API
- π Paginated Search Results β Load more results dynamically with pagination support
- π Personal Library β Add and manage your own reading list stored locally
- ποΈ Swipe to Delete β Remove books from your library with a swipe gesture
- π Book Detail Screen β View full details including cover, author, page count, and description
- π Open Book Preview β Launch book previews in a custom Chrome tab (in-app browser)
- π¬ Quote Sharing β Write a favorite quote on a book card and share it as an image
- π‘ Offline Support β Cached search results and library available without internet
- π Network Monitoring β Real-time connectivity detection with offline banner UI
- π Background Sync β Periodic library sync via WorkManager (every 6 days, on Wi-Fi + charging)
- π Snackbar Tips β Contextual hints shown to the user (e.g., swipe-to-delete tip on first book)
The project follows Clean Architecture with a clear separation of concerns:
com.paraspatil.readstack
β
βββ data/
β βββ local/ # Room database: BookDao, BookEntity, SearchResultEntity
β βββ remote/ # Retrofit API: GoogleBookApi, DTOs, Mappers
β βββ repository/ # BookRepositoryImpl
β βββ util/ # NetworkMonitor
β
βββ domain/
β βββ model/ # Book domain model
β βββ repository/ # BookRepository interface
β βββ util/ # NetworkResult sealed class
β
βββ ui/
β βββ library/ # LibraryScreen, LibraryViewModel, BookCard, QuoteShareCard
β βββ details/ # BookDetailScreen, BookDetailViewModel
β βββ theme/ # Material3 theme, colors, typography
β
βββ navigation/ # AppNavigation, AppScreens (type-safe routes)
βββ di/ # Hilt modules: AppModule, RepositoryModule, WorkManagerModule, DatabaseModule, NetworkModule
βββ workers/ # SyncWorker (WorkManager)
βββ ReadStackApp.kt # Hilt Application class
| Category | Technology |
|---|---|
| Language | Kotlin |
| UI Framework | Jetpack Compose + Material 3 |
| Architecture | Clean Architecture + MVVM |
| Dependency Injection | Hilt (Dagger) |
| Local Database | Room (v2.6.1) |
| Networking | Retrofit 2 + Kotlinx Serialization |
| Image Loading | Coil (v2.4.0) |
| Background Work | WorkManager (v2.9.0) |
| Navigation | Jetpack Navigation Compose (v2.8.5) with type-safe routes |
| Async/Concurrency | Kotlin Coroutines + Flow |
| In-App Browser | AndroidX Browser (Custom Tabs) |
| JSON Parsing | Gson + Kotlinx Serialization JSON |
| Icons | Material Icons Extended |
| Build System | Gradle Kotlin DSL + Version Catalog |
This project was built to explore and practice the following concepts:
- β
Jetpack Compose β Building declarative UI with state hoisting,
LaunchedEffect,collectAsState, and animated composables - β MVVM + Clean Architecture β Separating UI, domain, and data layers with clear contracts via interfaces
- β
Hilt Dependency Injection β Constructor injection,
@HiltViewModel,@HiltWorker, and Hilt modules - β
Room Database β Defining entities, DAO with
Flow,@Upsert, offline-first data access - β Retrofit + Kotlin Serialization β Type-safe API calls with serialization converter
- β
Kotlin Coroutines & Flow β
StateFlow,callbackFlow,combine,map,stateIn, coroutine scopes - β Offline-First Architecture β Caching search results in Room, serving local data when offline
- β WorkManager β Periodic background sync with constraints (network + charging)
- β
Type-Safe Navigation β Using
@Serializablesealed interface routes with Navigation Compose - β
NetworkMonitor β Real-time connectivity tracking using
ConnectivityManager.NetworkCallback - β
Canvas & Graphics β Capturing a composable as a bitmap using
GraphicsLayerto share as image - β
SwipeToDismiss β Implementing swipe-to-delete with
SwipeToDismissBox - β
Custom Chrome Tabs β Opening URLs inside the app using
AndroidX Browser - β
Pagination β Manual pagination with
startIndexandmaxResultsfor API calls
- Android Studio Hedgehog or newer
- Min SDK: 26 (Android 8.0)
- Target SDK: 36
- Kotlin: Latest stable
- Internet permission required (for Google Books API)
- A Google Books API Key (free) β Get one here
- Clone the repository
git clone https://github.com/PatilParas05/ReadStack.git
- Open in Android Studio
- Sync Gradle dependencies
- Add your Google Books API Key
- Go to
app/src/main/java/com/paraspatil/readstack/data/remote/GoogleBookApi.kt - Find the
API_KEYconstant in thecompanion object - Replace the empty string with your key:
const val API_KEY = "YOUR_API_KEY_HERE"
π Get a free API key from Google Cloud Console β Enable Books API β Create credentials
- Go to
- Run on an emulator or physical device (Android 8.0+)
| File | Description |
|---|---|
ReadStackApp.kt |
Hilt Application class + WorkManager setup |
MainActivity.kt |
Entry point, sets up Compose and navigation |
AppNavigation.kt |
Navigation graph with type-safe routes |
LibraryScreen.kt |
Main UI: library + search tabs, quote sharing |
LibraryViewModel.kt |
State management, search, pagination, sync |
BookRepositoryImpl.kt |
Data layer: API + Room + NetworkMonitor |
BookDao.kt |
Room DAO: library and search result queries |
SyncWorker.kt |
Background WorkManager sync worker |
NetworkMonitor.kt |
Real-time network connectivity observer |
GoogleBookApi.kt |
Retrofit API interface β add your API key here |
Contributions are welcome! Since this is a learning project, feel free to open issues or pull requests to suggest improvements, fix bugs, or add new features.
This project is created solely for educational and learning purposes. It is not intended for production use. The app uses the free Google Books API and does not store or transmit any personal user data.
Paras Patil β @PatilParas05
Happy Reading & Happy Learning! π