Skip to content

DarshReddy/TMDB_Assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TMDB - Top Rated TV Shows Android App

An Android application that displays top-rated TV shows from The Movie Database (TMDB) API using modern Android development practices.

πŸ“± Features

  • 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)

πŸ› οΈ Tech Stack & Architecture

Language & Framework

  • Kotlin - Primary programming language
  • Jetpack Compose - Modern declarative UI toolkit

Architecture & Design Patterns

  • MVVM (Model-View-ViewModel) - Architecture pattern
  • Dependency Injection - Dagger Hilt
  • Coroutines - Asynchronous programming

Libraries & Dependencies

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

πŸ“‹ Prerequisites

  • 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

πŸš€ Getting Started

1. Clone the Repository

git clone https://github.com/DarshReddy/TMDB_Assignment.git
cd TMDB_Assignment

2. Open in Android Studio

  1. Launch Android Studio
  2. Select "Open an Existing Project"
  3. Navigate to the cloned repository folder
  4. Click "OK" and wait for Gradle sync to complete

3. Build the Project

./gradlew build

Or use Android Studio's Build menu:

  • Build > Make Project (Ctrl+F9 / Cmd+F9)

4. Run the App

Connect an Android device or start an emulator, then:

./gradlew installDebug

Or click the Run button in Android Studio (Shift+F10 / Ctrl+R)

πŸ“‚ Project Structure

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

πŸ”‘ API Configuration

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

🎨 UI Components

MainActivity

  • Entry point of the application
  • Hosts the Compose UI with MoviesGrid composable

MoviesGrid Composable

  • 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)

Color-Coded Rating System

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

πŸ—οΈ Build Variants

  • Debug: Development build with debugging enabled
  • Release: Production-ready build with ProGuard optimization (when configured)

πŸ“¦ Dependencies Management

This project uses Gradle Version Catalog (libs.versions.toml) for centralized dependency management.

πŸ§ͺ Testing

Run Unit Tests

./gradlew test

Run Instrumented Tests

./gradlew connectedAndroidTest

πŸ”§ Troubleshooting

Common Issues

  1. Gradle Sync Failed

    • Ensure you have a stable internet connection
    • Try: File > Invalidate Caches / Restart
  2. Build Errors

    • Clean the project: ./gradlew clean
    • Rebuild: ./gradlew build
  3. API Issues

    • Verify internet connectivity
    • Check if TMDB API is accessible
    • Ensure the API key is valid

πŸ“„ License

This project is for educational/assignment purposes.

🀝 Contributing

This is an assignment project. For any questions or issues, please contact the repository owner.

πŸ“ž Contact


Note: This app requires an active internet connection to fetch data from TMDB API.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages