Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Modern Movie App in Jetpack Compose

NotificationsYou must be signed in to change notification settings

androiddevnotes/android-modern-movie-app

Repository files navigation

Overview

This Android app interacts with The Movie Database (TMDB) API. Every line of code has been generatedor suggested by AI using a large language model.

Alpha = TMDBBeta = OpenAI

Current state

The codebase evolves as the AI generates more and more code.

Detail ScreenGrid View List Screen
Simple View List ScreenFilter Bottom Sheet

Setup

  1. Get a TMDB API key fromthemoviedb.org.
  2. Add togradle.properties:
    TMDB_API_KEY="your_api_key_here"
  3. Sync project with Gradle files.

Tech Stack

  • Language: Kotlin
  • UI Framework: Jetpack Compose
  • Architecture: MVVM (Model-View-ViewModel)
  • Networking: Ktor Client for Android
  • JSON Parsing: Gson
  • Image Loading: Coil
  • Asynchronous Programming: Kotlin Coroutines
  • Navigation: Jetpack Navigation Compose
  • Dependency Injection: Manual (no DI framework used yet)
  • UI Components: Material Design 3
  • Build System: Gradle with Kotlin DSL
  • Minimum SDK: 21 (Android 5.0 Lollipop)
  • Target SDK: 34 (Android 14)

Key Features

  1. Browse movies by different categories (popular, top-rated, etc.)
  2. Search for movies
  3. View detailed movie information
  4. Mark movies as favorites
  5. Create custom movie lists (authenticated users only)
  6. Switch between grid and list views
  7. Apply filters (genre, release year, minimum rating)
  8. Toggle between light and dark themes

Architecture

The app follows the MVVM (Model-View-ViewModel) architecture:

  • Model: Represented by theMovie andMovieResponse data classes
  • View: Compose UI components in various screen files
  • ViewModel:MovieViewModel manages the app's state and business logic

Data Flow

  1. TheMovieViewModel fetches data from theMovieRepository
  2. The repository makes API calls using theApiService
  3. Data is then exposed to the UI components via StateFlows in the ViewModel
  4. UI components observe these flows and recompose when the data changes

Authentication Flow

  1. User initiates authentication from the ListCreationScreen
  2. App obtains a request token from the TMDB API
  3. User approves the request token via a web browser
  4. App exchanges the approved token for a session ID
  5. Session ID is stored for future authenticated requests

[8]ページ先頭

©2009-2025 Movatter.jp