GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - vipulshah2010/KMPMovies: KMPMovies is a lightweight Kotlin Multiplatform application built and showcased as part of the Kotlin Multiplatform Development Workshop

BranchesTags
Open more actions menu

Latest commit

 

History

24 Commits
24 Commits

Folders and files

NameName
Last commit message
Last commit date
SharedCode
SharedCode
 
 
app
app
 
 
gradle
gradle
 
 
iOSMovie
iOSMovie
 
 
previews
previews
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle.kts
build.gradle.kts
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle.kts
settings.gradle.kts
 
 

Repository files navigation

Kotlin Multiplatform Movies

License

A Kotlin Multiplatform movie listing app showing Now Playing films via the TMDB API.
Shared network/domain logic consumed by Android (Jetpack Compose) and iOS (SwiftUI).


iOS [SwiftUI] Android [Jetpack Compose]

Tech Stack

Shared (commonMain)

Library Version Purpose
Kotlin Multiplatform 2.1.21 Shared code targeting Android + iOS
Ktor 3 (CIO / Darwin) 3.1.3 HTTP client (CIO on Android, Darwin on iOS)
kotlinx.serialization 1.7.3 JSON deserialization
kotlinx.coroutines 1.9.0 Async via suspend / Flow

Android

Library Version Purpose
Jetpack Compose BOM 2024.12.01 UI toolkit
Material 3 (BOM) Theming & components
Coil 3 3.0.4 Image loading (AsyncImage)
Lifecycle / ViewModel 2.8.7 State management via StateFlow

iOS

Technology Purpose
SwiftUI UI framework
AsyncImage Image loading (no third-party library)
Swift async/await via Task {} Consuming Kotlin suspend functions

Project Structure

.
├── SharedCode/                 # KMP shared module
│   └── src/
│       ├── commonMain/kotlin/
│       │   ├── model/          # Movie, Movies data classes
│       │   ├── MoviesRepository.kt
│       │   └── HttpClientFactory.kt  (expect)
│       ├── androidMain/kotlin/
│       │   └── HttpClientFactory.kt  (actual — CIO engine)
│       ├── iosMain/kotlin/
│       │   └── HttpClientFactory.kt  (actual — Darwin engine)
│       └── commonTest/kotlin/
│           └── MoviesDeserializationTest.kt
├── app/                        # Android application module
│   └── src/main/java/com/vipul/movieapp/
│       ├── MainActivity.kt     # ComponentActivity + Compose UI
│       ├── MovieViewModel.kt   # StateFlow-based ViewModel
│       ├── MovieResult.kt      # Sealed class for UI state
│       └── ui/theme/
│           └── MovieAppTheme.kt
└── iOSMovie/                   # Xcode project (SwiftUI)
    └── iOSMovie/
        ├── ContentView.swift
        ├── MovieService.swift  # @MainActor ObservableObject
        └── ProgressBar.swift

Setup

Prerequisites

  • Android Studio Meerkat or newer
  • Xcode 15+ (for iOS)
  • JDK 17
  • Gradle 8.13 (wrapper included)

Android

  1. Open the repo root in Android Studio.
  2. Let Gradle sync complete.
  3. Run the :app configuration on an emulator or device (API 26+, API 35 recommended).
./gradlew :app:assembleDebug

Shared module tests

./gradlew :SharedCode:test

iOS

Note: iOS requires building the SharedCode framework first.

  1. From the repo root, run:

    ./gradlew :SharedCode:buildForXcode

    This produces SharedCode/build/xcode-frameworks/SharedCode.framework.

  2. In Xcode, verify the framework search path in the iOSMovie target points to ../SharedCode/build/xcode-frameworks.

  3. Open iOSMovie/iOSMovie.xcodeproj and build the iOSMovie scheme.


Key Architecture Decisions

  • No GlobalScope — coroutines are scoped to viewModelScope (Android) and Task {} tied to SwiftUI's .task {} modifier (iOS).
  • suspend fun API — MoviesRepository.getMovies() is a plain suspend fun annotated with @Throws. Kotlin 2.x KMP exports it as async throws in Swift.
  • Result handling — errors are caught in the ViewModel and surfaced as MovieResult.Error; no silent failures.
  • Image loading — URLs only are shared; actual loading is platform-native (Coil 3 on Android, AsyncImage on iOS).
  • Version catalog — all dependencies declared in gradle/libs.versions.toml.

License

Copyright 2020 Vipul Shah

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

KMPMovies is a lightweight Kotlin Multiplatform application built and showcased as part of the Kotlin Multiplatform Development Workshop

Topics

androidjetpack-composekotlinkotlin-coroutineskotlin-multiplatformktor-clientmaterial-uimultiplatform-kotlin-libraryswiftui

Resources

Readme
Apache-2.0 license
Activity

Stars

7 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.