This Android app fetches book data from the Stephen King API, focusing on specific fields like Title, Publisher, ISBN, and Year. The data is stored in a local Room database and displayed in a RecyclerView using the MVVM architectural pattern.
- Android SDK
- JAVA | Kotlin
- Retrofit
- Room Database
- RecyclerView
- MVVM
The project follows a standard MVVM architecture with the following package structure:
com.example.mybooksapp- Adapter: Contains the
BookAdapterfor displaying book data in the RecyclerView. - Dao: Includes the
BookDaointerface for database operations. - Database: Defines the
BookDatabaseclass for managing the Room database. - Model: Contains the
Bookdata class representing a book entity with the following fields:id(Int)Title(String)Publisher(String)ISBN(String)Year(String)
- Network: Handles network requests using Retrofit with the Api interface (likely named
StephenKingApior similar). - Repository: The
BookRepositoryclass mediates data access between the network and database. - ViewModel: The
BookViewModelexposes data to the UI and handles business logic. - MainActivity: The main activity of the app.
- Adapter: Contains the
The app utilizes Retrofit to consume the Stephen King API, specifically targeting the fields mentioned in the Book data class. The fetched book data is parsed and mapped to Book objects for further processing.
A Room database is employed to store book data locally. Data Access Objects (DAOs) provide methods for inserting, querying, and updating book information based on the defined fields in the Book class.
Working Architecture of the Application

