This is the starter code for a Kotlin Multiplatform project targeting Android and iOS platforms. This repository provides the foundational project structure and basic domain models to get started building a conference management application.
This starter code provides:
- Project Structure: Pre-configured Kotlin Multiplatform modules (composeApp, shared, iosApp)
- Domain Models: Basic
SessionandSpeakerdata classes with kotlinx.serialization - Platform Setup: Android and iOS application entry points configured
- Build Configuration: Gradle build scripts with Compose Multiplatform dependencies
- Package Structure: Organized using
com.droidcon.globalnamespace
Before you clone & run this starter code, you must ensure your development environment is set up correctly for Kotlin Multiplatform (KMP) development.
KMP requires tooling from both the Android and Apple ecosystems to compile native apps for both platforms.
β οΈ Critical Hardware Requirement: To build and run the iOS application, you must be using a Macintosh computer running macOS. Windows and Linux users will only be able to build and run the Android application.
Please complete the following steps in order to configure your machine.
To compile the iOS app, you need Apple's official development environment.
-
Download Xcode: Install the latest stable version of Xcode from the Mac App Store. Note: This is a large download.
-
Accept License & Install Components: Once installed, open Xcode at least once. It will prompt you to install additional components and accept the license agreement. You must agree to proceed.
-
Install Command Line Tools: Open your terminal and run the following command to install necessary build tools:
xcode-select --install
-
Download Simulator Runtime: In Xcode, go to Settings > Platforms and ensure you have downloaded at least one iOS Simulator runtime (e.g., iOS 17.x).
Android Studio is the primary IDE we will use for writing code on both platforms.
-
Download: Download and install the latest stable version of Android Studio from the official website.
-
Setup Wizard: During the initial setup wizard, ensure the following components are checked for installation:
- Android SDK
- Android SDK Platform
- Android Virtual Device (AVD)
-
Verify SDK: Open Android Studio, go to Settings/Preferences > Languages & Frameworks > Android SDK, and ensure the "Android SDK Command-line Tools" are installed under the "SDK Tools" tab.
To ensure all the complex moving parts between Java, Android, and Xcode are configured correctly, we use a diagnostic tool from JetBrains called KDoctor.
-
Install KDoctor via Homebrew by running this command in your terminal:
brew install kdoctor
-
Run Diagnostics: Run the tool by typing:
kdoctor
Your Goal: KDoctor should output green checkmarks [v] next to the following sections:
- [v] System
- [v] Java
- [v] Android Studio
- [v] Xcode
If you see any red failures [x], KDoctor will provide specific commands to fix them. Run those commands and rerun kdoctor until everything is green.
(Note: You may ignore warnings regarding CocoaPods if they appear, as this project does not heavily rely on them.)
β Once your environment is set up, you are ready to clone this repository and open it in Android Studio!
- Android Minimum SDK: API 24 (Android 7.0)
- Android Compile SDK: As defined in
gradle/libs.versions.toml - macOS Version: Version 12.0 (Monterey) or later (for iOS development)
- iOS Deployment Target: As configured in the Xcode project
ConferenceIODemo/
βββ composeApp/ # Compose Multiplatform application module
β βββ src/
β β βββ androidMain/ # Android-specific implementations
β β βββ commonMain/ # Shared UI and business logic
β β βββ iosMain/ # iOS-specific implementations
β β βββ commonTest/ # Shared unit tests
β βββ build.gradle.kts # App module build configuration
β
βββ shared/ # Shared business logic module
β βββ src/
β βββ commonMain/ # Domain models and common code
β βββ androidMain/ # Android-specific shared code
β
βββ iosApp/ # iOS application entry point
β βββ iosApp/ # SwiftUI app code and Xcode project
β
βββ gradle/ # Gradle wrapper and version catalog
βββ build.gradle.kts # Root build configuration
βββ settings.gradle.kts # Project settings
Located in shared/src/commonMain/kotlin/com/droidcon/global/domain/model/:
Session.kt
data class Session(
val id: String,
val title: String,
val description: String,
val startTime: String,
val endTime: String,
val room: String,
val speakerId: String,
val isServiceSession: Boolean
)Speaker.kt
data class Speaker(
val id: String,
val name: String,
val bio: String,
val avatar: String,
val company: String,
val sessionId: String
)Both models are annotated with @Serializable for kotlinx.serialization support.
git clone https://github.com/kshitizbali/Udacity-Demo-Project.git
cd ConferenceIODemoUsing Android Studio:
- Open the project in Android Studio
- Wait for Gradle sync to complete
- Select the
composeApprun configuration - Click the Run button or press
Shift + F10
Using Command Line:
-
On macOS/Linux:
./gradlew :composeApp:assembleDebug
-
On Windows:
.\gradlew.bat :composeApp:assembleDebug
To install on a connected device or emulator:
./gradlew :composeApp:installDebugPrerequisites: Must be on macOS with Xcode installed
Using Android Studio:
- Select the
iosApprun configuration - Choose an iOS Simulator
- Click the Run button
Using Xcode:
- Open the
iosAppdirectory in Xcode:open iosApp/iosApp.xcodeproj
- Select a simulator or connected iOS device
- Click the Run button or press
Cmd + R
This starter code provides the foundation. You can now:
- Implement API integration to fetch sessions and speakers
- Create UI screens to display conference data
- Add navigation between screens
- Implement state management
- Add error handling and loading states
- Customize the UI theme and styling
The following mock APIs are available for development:
- Sessions API:
https://694e2d80b5bc648a93bf8dd0.mockapi.io/api/v1/sessions - Speakers API:
https://694e2d80b5bc648a93bf8dd0.mockapi.io/api/v1/sessions/:id/speakers
For detailed API response structures, see plan/api_response_updated.md
All code uses the com.droidcon.global namespace:
com.droidcon.global- Main application code and UIcom.droidcon.global.domain.model- Domain models (Session, Speaker)
- Kotlin Multiplatform: Shared code across platforms
- Compose Multiplatform: Declarative UI framework
- kotlinx.serialization: JSON serialization/deserialization
- Gradle: Build system with Kotlin DSL
- Material 3: Modern UI design system
-
Gradle Sync Failed
- Ensure you have a stable internet connection
- Try: File β Invalidate Caches β Invalidate and Restart
- Check that JDK 11+ is configured in Android Studio
-
iOS Build Errors
- Ensure Xcode Command Line Tools are installed:
xcode-select --install - Clean build folder in Xcode: Product β Clean Build Folder
- Update CocoaPods:
sudo gem update cocoapods
- Ensure Xcode Command Line Tools are installed:
-
Package Name Errors
- Ensure all files use
com.droidcon.globalpackage namespace - Clean and rebuild:
./gradlew clean build
- Ensure all files use