An Android application that displays top-rated TV shows from The Movie Database (TMDB) API using modern Android development practices.
- Display top-rated TV shows in a grid layout
- Shows poster images for each TV show
- Visual rating indicators with color-coded circular progress bars:
- π’ Green: Rating > 8
- π‘ Yellow: Rating > 5
- π΄ Red: Rating β€ 5
- Display show name and air year
- Responsive grid layout (3 columns)
- Kotlin - Primary programming language
- Jetpack Compose - Modern declarative UI toolkit
- MVVM (Model-View-ViewModel) - Architecture pattern
- Dependency Injection - Dagger Hilt
- Coroutines - Asynchronous programming
| Library | Purpose |
|---|---|
| Jetpack Compose | Modern UI toolkit |
| Hilt | Dependency injection |
| Retrofit | REST API client |
| Moshi | JSON parsing |
| OkHttp | HTTP client |
| Coil | Image loading and caching |
| Coroutines | Asynchronous operations |
| StateFlow | Reactive state management |
- Android Studio: Arctic Fox or newer
- JDK: Version 8 or higher
- Android SDK:
- Minimum SDK: 26 (Android 8.0)
- Target SDK: 34 (Android 14)
- Compile SDK: 34
git clone https://github.com/DarshReddy/TMDB_Assignment.git
cd TMDB_Assignment- Launch Android Studio
- Select "Open an Existing Project"
- Navigate to the cloned repository folder
- Click "OK" and wait for Gradle sync to complete
./gradlew buildOr use Android Studio's Build menu:
- Build > Make Project (Ctrl+F9 / Cmd+F9)
Connect an Android device or start an emulator, then:
./gradlew installDebugOr click the Run button in Android Studio (Shift+F10 / Ctrl+R)
TMDB_Assignment/
βββ app/
β βββ src/
β β βββ main/
β β β βββ java/com/assignment/tmdb/
β β β β βββ data/ # Data models
β β β β β βββ TopRated.kt # Response and result data classes
β β β β βββ di/ # Dependency injection
β β β β β βββ AppModule.kt # Hilt module
β β β β βββ network/ # Network layer
β β β β β βββ ApiClient.kt # Retrofit API interface
β β β β βββ ui/theme/ # UI theming
β β β β β βββ Color.kt
β β β β β βββ Theme.kt
β β β β β βββ Type.kt
β β β β βββ MainActivity.kt # Main activity with Compose UI
β β β β βββ MainViewModel.kt # ViewModel
β β β β βββ TmdbApplication.kt # Application class
β β β βββ res/ # Resources
β β β βββ AndroidManifest.xml
β β βββ androidTest/ # Instrumented tests
β β βββ test/ # Unit tests
β βββ build.gradle.kts # App-level Gradle configuration
βββ gradle/ # Gradle wrapper
βββ build.gradle.kts # Project-level Gradle configuration
βββ settings.gradle.kts # Gradle settings
βββ README.md # This file
This app uses the TMDB API to fetch top-rated TV shows. The API key is configured in the AppModule.kt file using Bearer token authentication.
Base URL: https://api.themoviedb.org/3/
Endpoint Used: tv/top_rated
- Entry point of the application
- Hosts the Compose UI with
MoviesGridcomposable
- Displays a lazy vertical grid with 3 columns
- Each item shows:
- Poster image loaded with Coil
- Circular progress indicator showing rating
- Show title
- First air date (year)
The app uses a visual rating system with colored circular progress indicators:
- Green (> 8.0): Excellent shows
- Yellow (5.0 - 8.0): Good shows
- Red (β€ 5.0): Below average shows
- Debug: Development build with debugging enabled
- Release: Production-ready build with ProGuard optimization (when configured)
This project uses Gradle Version Catalog (libs.versions.toml) for centralized dependency management.
./gradlew test./gradlew connectedAndroidTest-
Gradle Sync Failed
- Ensure you have a stable internet connection
- Try: File > Invalidate Caches / Restart
-
Build Errors
- Clean the project:
./gradlew clean - Rebuild:
./gradlew build
- Clean the project:
-
API Issues
- Verify internet connectivity
- Check if TMDB API is accessible
- Ensure the API key is valid
This project is for educational/assignment purposes.
This is an assignment project. For any questions or issues, please contact the repository owner.
- GitHub: @DarshReddy
Note: This app requires an active internet connection to fetch data from TMDB API.