Skip to content

Useless facts every day! Here's an example of a multiplatform app with shared UI and network logic built with Kotlin Multiplatform and Compose Multiplatform for Android, iOS and Desktop.

License

Notifications You must be signed in to change notification settings

vladleesi/factastic

Repository files navigation

Factastic

Useless facts every day!

Here's an example of a multiplatform app with shared UI and network logic built with Kotlin Multiplatform Mobile and Compose Multiplatform for Android, iOS and Desktop.

Android (Dark theme) iOS (Light theme)
Android (Dark theme) iOS (Light theme)
Desktop
Screen Recording 2023-08-06 at 5 02 11 PM (1)

Stack

Project Structure

The project follows the Kotlin Multiplatform structure, allowing code sharing between Android and iOS platforms. Here's a brief overview of the project structure:

  • shared: Contains shared Kotlin code that is used by both Android and iOS.
  • androidApp: Contains the Android-specific code, including activities, UI components, and Android-specific dependencies.
  • iosApp: Contains the iOS-specific code, including view controllers, SwiftUI views, and iOS-specific dependencies.
  • desktop: Contains the desktop-specific code for the Kotlin Multiplatform project, targeting desktop platforms such as Windows, macOS, and Linux.

Build

Android:

  1. Open androidApp folder from Android Studio
  2. Click Run

iOS:

  1. Open iosApp/iosApp.xcodeproj folder from Xcode
  2. Click Run

Desktop:

  1. Open the project from Android Studio
  2. Execute the command ./gradle :desktop:run to run the desktop module.

Since IntelliJ IDEA currently does not support Gradle versions above 7.4.0, follow these steps to address the issue:

  1. In the gradle.properties file, temporarily change the Gradle plugin version to 7.4.0.
  2. In the settings.gradle.kts file, disable the inclusion of (":androidApp").

Licence

This project is licensed under the MIT License.