This is a compact library catalogue application developed as an Android mobile application. The Library app presents a scrollable list of book entries sourced from a local JSON asset, showing cover art, titles, authors, ISBNs, and synopses. It demonstrates core Android patterns such as RecyclerView adapters, view holders, and Material card-based layouts for clean, readable content presentation.
The Library Android application offers the following features:
-
RecyclerView Book List
- Efficient scrollable list for book entries
- LinearLayoutManager for smooth vertical scrolling
- View holder pattern for performance and reuse
-
Book Cards
- MaterialCardView layout for each book
- Cover image, title, author, ISBN, and synopsis
- ConstraintLayout for tidy, responsive alignment
-
Local JSON Data Source
- Book data stored in
assets/books.json - Simple parsing with
org.jsonto populate the list - No network dependency for content
- Book data stored in
-
Cover Image Rendering
- Drawable-based cover images loaded by resource name
- Centre-inside scaling to preserve cover proportions
- Clean, minimal card background styling
-
Modern Android UI
- Material Design components
- Consistent typography and spacing
- Light theme styling with clear contrast
-
Data Model Separation
Bookmodel for structured dataBookAdapterfor binding data to UIMainActivityfor list initialisation and setup
- Java 8: Primary programming language
- Source and target compatibility with Java 8 features
- Android SDK 33: Android 13 compile and target SDK
- Minimum SDK: API 30 (Android 11)
- Target SDK: API 33 (Android 13)
- Android Gradle Plugin 8.0.1: Android build tooling
- Gradle 8.0: Build automation and dependency management
- AndroidX Libraries:
- AppCompat 1.6.1: Backward compatibility support
- Material Components 1.5.0: Material Design UI components
- ConstraintLayout 2.1.4: Advanced layout management
- Testing Frameworks:
- JUnit 4.13.2: Unit testing framework
- AndroidX Test Ext JUnit 1.1.5: Android instrumentation testing
- Espresso Core 3.5.1: UI testing automation
- Platform: Android Mobile Application
- Programming Language: Java
- Minimum Android Version: Android 11 (API 30)
- Target Android Version: Android 13 (API 33)
- Application ID: com.example.library
- Version: 1.0 (Version Code: 1)
- Build System: Gradle with Android plugins
- Architecture Pattern: RecyclerView adapter pattern with model separation
To run the Library Android application locally, follow these steps:
-
Prerequisites:
- Install Android Studio (Electric Eel or later recommended)
- Ensure Java Development Kit (JDK) 8 or higher is installed
- Set up an Android Virtual Device (AVD) or connect a physical Android device
-
Clone the repository:
git clone https://github.com/supunxiii/library-app.git
-
Navigate to the project directory:
cd library-app -
Open the project in Android Studio:
- Launch Android Studio
- Select "Open an Existing Project"
- Navigate to the cloned repository directory
- Click "OK" to open the project
-
Sync the project with Gradle:
- Android Studio should automatically prompt to sync
- If not, click "File" -> "Sync Project with Gradle Files"
- Wait for the sync to complete
-
Run the application:
- Select your target device (emulator or physical device)
- Click the "Run" button (green play icon) or press
Shift + F10 - The application will build and install on your selected device
-
Alternative: Build from command line:
# On macOS/Linux ./gradlew assembleDebug # On Windows gradlew.bat assembleDebug
The APK will be generated in
app/build/outputs/apk/debug/
library-app/
├── .gradle/ # Gradle cache and build files
├── .idea/ # Android Studio IDE configurations
├── app/ # Main application module
│ ├── src/
│ │ ├── main/
│ │ │ ├── assets/
│ │ │ │ └── books.json # Book data source
│ │ │ ├── java/com/example/library/
│ │ │ │ ├── MainActivity.java # Main activity class
│ │ │ │ ├── BookAdapter.java # RecyclerView adapter
│ │ │ │ └── Book.java # Data model class
│ │ │ ├── res/
│ │ │ │ ├── drawable/ # Book covers and drawable assets
│ │ │ │ └── layout/
│ │ │ │ ├── activity_main.xml # Main layout with RecyclerView
│ │ │ │ └── book_layout.xml # Book card layout
│ │ │ └── AndroidManifest.xml # App manifest
│ │ ├── androidTest/ # Instrumented tests
│ │ └── test/ # Unit tests
│ ├── build.gradle # App-level build config
│ └── proguard-rules.pro # ProGuard rules
├── gradle/ # Gradle wrapper files
│ └── wrapper/
├── build.gradle # Project-level build config
├── gradle.properties # Gradle properties
├── gradlew # Gradle wrapper script (Unix)
├── gradlew.bat # Gradle wrapper script (Windows)
├── settings.gradle # Project settings
└── README.md # This file
To build the project in different configurations:
# Debug build
./gradlew assembleDebug
# Release build (requires signing configuration)
./gradlew assembleRelease
# Clean and rebuild
./gradlew clean assembleDebug# Run unit tests
./gradlew test
# Run instrumented tests (requires connected device/emulator)
./gradlew connectedAndroidTest
# Run all tests
./gradlew testDebug connectedAndroidTestThis project was developed by:
- Supun Wijesooriya - Developer
Contributions to the Library application are welcome! If you would like to contribute, please follow these steps:
-
Fork the repository.
-
Create a new branch:
git checkout -b feature/your-feature-name
-
Make your changes and commit them:
git commit -m "Add your commit message" -
Push your changes to your forked repository:
git push origin feature/your-feature-name
-
Open a pull request to the main repository, describing your changes and the purpose of the pull request.
- This application requires Android 11 (API 30) or higher to run
- The application is optimised for mobile devices running Android 11-13
- Uses RecyclerView for efficient memory management and smooth scrolling
- Material Design components ensure consistent UI across different Android devices
- ProGuard rules are included for code optimisation in release builds
- Book data is stored in local JSON assets for easy maintenance
Potential improvements for future versions:
- Book detail pages with extended information
- Search functionality to find specific titles or authors
- Favourites list for bookmarked books
- Category filters for genres or authors
- Offline data updates with local storage
- Share book details via social media
- UI animations for card interactions
- Dark theme styling with custom colour schemes
For any inquiries or feedback, please contact the developer:
- Supun Wijesooriya: GitHub Profile
- Project Repository: library-app
Note: This is a beginner-friendly programme designed to understand Android native application development. The project covers fundamental concepts including RecyclerView implementation, Activity lifecycle management, adapter patterns, ConstraintLayout usage, XML-based UI design, resource management (drawables and assets), Material Design principles, and AndroidX library integration. This application serves as a learning resource for building scrollable lists with custom layouts in Android.
