A comprehensive Android application demonstrating modern Android development practices, API integration, and clean architecture patterns. This project showcases the implementation of a complete mobile application with user authentication, data management, and dynamic content display.
- 🔐 Secure Authentication: JWT-based login system with API integration
- 📊 Dynamic Dashboard: Real-time entity management with search and filtering
- 🎨 Modern UI/UX: Material Design 3 components with dark/light theme support
- 🏗️ Clean Architecture: MVVM pattern with proper separation of concerns
- 💉 Dependency Injection: Hilt integration for better testability and maintainability
- 🌐 API Integration: RESTful API communication using Retrofit and OkHttp
- 📱 Responsive Design: Optimized for various screen sizes and orientations
- 🧪 Comprehensive Testing: Unit tests for ViewModels and Repository layer
Component | Technology |
---|---|
Language | Kotlin |
Architecture | MVVM (Model-View-ViewModel) |
UI Framework | Android XML Layouts with Material Design 3 |
Networking | Retrofit 2.x + OkHttp |
Dependency Injection | Hilt |
Image Loading | Coil |
Build System | Gradle with Kotlin DSL |
Testing | JUnit 4 + Mockito |
Minimum SDK | API 24 (Android 7.0) |
Target SDK | API 34 (Android 14) |
Android-API-Integration-NIT3213/
├── app/
│ ├── src/
│ │ ├── main/
│ │ │ ├── java/com/example/assignmentlast/
│ │ │ │ ├── data/
│ │ │ │ │ ├── api/
│ │ │ │ │ │ └── ApiService.kt # API service interfaces
│ │ │ │ │ ├── models/
│ │ │ │ │ │ ├── DashboardResponse.kt # Dashboard API response model
│ │ │ │ │ │ ├── Entity.kt # Entity data model
│ │ │ │ │ │ ├── LoginRequest.kt # Login request model
│ │ │ │ │ │ └── LoginResponse.kt # Login response model
│ │ │ │ │ └── repository/
│ │ │ │ │ └── AppRepository.kt # Repository interface
│ │ │ │ ├── di/
│ │ │ │ │ └── AppModule.kt # Hilt dependency injection module
│ │ │ │ ├── ui/
│ │ │ │ │ ├── dashboard/
│ │ │ │ │ │ ├── DashboardActivity.kt # Dashboard screen activity
│ │ │ │ │ │ ├── DashboardViewModel.kt # Dashboard business logic
│ │ │ │ │ │ └── EntityAdapter.kt # RecyclerView adapter
│ │ │ │ │ ├── details/
│ │ │ │ │ │ └── DetailsActivity.kt # Entity details screen
│ │ │ │ │ └── login/
│ │ │ │ │ ├── LoginActivity.kt # Login screen activity
│ │ │ │ │ └── LoginViewModel.kt # Login business logic
│ │ │ │ ├── MainActivity.kt # Main application entry point
│ │ │ │ └── MyApplication.kt # Application class with Hilt
│ │ │ ├── res/
│ │ │ │ ├── drawable/ # Vector drawables and backgrounds
│ │ │ │ ├── layout/ # XML layout files
│ │ │ │ ├── mipmap/ # App icons
│ │ │ │ ├── values/ # Colors, strings, themes
│ │ │ │ └── xml/ # Backup and data extraction rules
│ │ │ └── AndroidManifest.xml # App manifest
│ │ └── test/
│ │ └── java/com/example/assignmentlast/
│ │ ├── AppRepositoryImplTest.kt # Repository unit tests
│ │ ├── DashboardViewModelTest.kt # Dashboard ViewModel tests
│ │ └── LoginViewModelTest.kt # Login ViewModel tests
│ ├── build.gradle # App-level build configuration
│ └── proguard-rules.pro # ProGuard rules
├── gradle/
│ └── libs.versions.toml # Dependency version catalog
├── build.gradle # Project-level build configuration
├── gradle.properties # Gradle properties
├── settings.gradle # Project settings
├── gradlew # Gradle wrapper script (Unix)
├── gradlew.bat # Gradle wrapper script (Windows)
└── README.md # This file
Before running this project, ensure you have the following installed:
- Android Studio Hedgehog (2023.1.1) or later
- Android SDK 34 or later
- Java 17 or later
- Git for version control
-
Clone the Repository
git clone https://github.com/eshant-alfa/Android-API-Integration-NIT3213.git cd Android-API-Integration-NIT3213
-
Open in Android Studio
- Launch Android Studio
- Select "Open an existing Android Studio project"
- Navigate to the cloned directory and select it
-
Sync Project
- Wait for Android Studio to sync Gradle files
- If prompted, update Gradle version if needed
- Ensure all dependencies are downloaded
-
Configure API Endpoints
- Open
app/src/main/java/com/example/assignmentlast/data/api/ApiService.kt
- Update the
BASE_URL
constant with your API endpoint
companion object { const val BASE_URL = "https://nit3213api.onrender.com/" }
- Open
-
Build and Run
- Connect an Android device or start an emulator
- Click the "Run" button (
▶️ ) in Android Studio - Select your target device and wait for the app to install
-
Launch the Application
- The app starts with the login screen
- Enter your credentials in the provided fields
-
Login Process
- Enter username and password
- Tap "Login" button
- The app will authenticate with the API
- Upon successful authentication, you'll be redirected to the dashboard
-
Entity Management
- View all entities in a scrollable list
- Each entity displays key information in a card format
- Tap on any entity to view detailed information
-
Search and Filter
- Use the search functionality to find specific entities
- Filter entities based on different criteria
- Real-time search results as you type
-
Entity Details
- Tap on any entity card to view comprehensive details
- Navigate back to dashboard using the back button
- View all entity properties and metadata
- Login Screen → Dashboard (automatic after successful login)
- Dashboard → Entity Details (tap on entity card)
- Entity Details → Dashboard (back button)
-
Unit Tests
./gradlew test
-
Instrumented Tests (if available)
./gradlew connectedAndroidTest
-
All Tests
./gradlew check
The project includes comprehensive unit tests for:
- Repository Layer: API integration and data handling
- ViewModel Layer: Business logic and state management
- Data Models: Model validation and serialization
Update the API configuration in ApiService.kt
:
interface ApiService {
companion object {
const val BASE_URL = "https://nit3213api.onrender.com/"
const val TIMEOUT_SECONDS = 30L
}
@POST("login")
suspend fun login(@Body request: LoginRequest): Response<LoginResponse>
@GET("dashboard")
suspend fun getDashboard(): Response<DashboardResponse>
}
Key build configurations in app/build.gradle
:
android {
compileSdk 34
defaultConfig {
minSdk 24
targetSdk 34
versionCode 1
versionName "1.0"
}
}
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is created for educational purposes as part of the NIT3213 Mobile Application Development course.
Eshant Alfa - NIT3213 Student
- GitHub: @eshant-alfa
- Course instructor for guidance and support
- Android development community for best practices
- Material Design team for UI components
- Open source contributors for libraries used in this project
Note: This project demonstrates advanced Android development concepts and should be used as a learning resource for mobile application development.