Skip to content

cmota/kmp-a-multiplatform-triathlon

Repository files navigation

A Multiplatform Triathlon

Kotlin Multiplatform is here! 🙌

A Multiplatform Triathlon is a project built using Kotlin Multiplatform and targeting:

  • Android
  • iOS
  • Web

👉 Source Code

👉 Presentation

Set up the environment

There are a couple of options here depending on your own preference. Recently, after KMM plugin was released to Android Studio I've changed my setup to:

  • Android Studio 4.1 with KMM plugin.
  • Xcode 11.7.

You can also use AppCode instead of Xcode or Intellij IDEA instead of Android Studio.

Getting Started

Installing CocoaPods

On Mac is really simple to install CocoaPods, just open the terminal and execute the following command:

sudo gem install cocoapods

Compiling the project for Android

Now that you've got your environment ready, it's time to compile the project! Don't forget to download:

  1. Clone the project locally
git clone https://github.com/cmota/kmp-a-multiplatform-triathlon.git
  1. Now open Starter Project on Android Studio (with KMM plugin installed).

  2. You'll need to wait until gradle runs all the tasks. You can get up and stretch your legs a bit, this is going to take some minutes.

  3. Compile and run the app.

Compiling the project for iOS

  1. Clone the project locally
git clone https://github.com/cmota/kmp-a-multiplatform-triathlon.git
  1. Now open Starter Project on Android Studio (with KMM plugin installed).

  2. You'll need to wait until gradle runs all the tasks. You can get up and stretch your legs a bit, this is going to take some minutes.

  3. Compile and run the app.

  4. Now it's to compile for iOS! First, go to the iosApp inside the Starter Project folder on the command line.

cd kmp-a-multiplatform-triathlon/
cd Starter\ Project/
cd iosApp
  1. Enter pod install to install all the of its dependencies
pod install
  1. Now that everything is installed let's open the iosApp.xcworkspace with Xcode.

Note: There are two project files inside the iosApp folder. It's easier to distinguish by the icon, the one that you need to open is the one that is white (extension .xcworkspace).

  1. Now click on compile and run and let's see the app running on the iOS simulator/ iPhone!

Compiling the project for the Web

  1. To compile for the web just enter the following command on terminal:
./gradlew web:run --continuous

Libraries

Screens

Android App Screens iOS App Screens Web Screens

Other Resources

I've created a codelab where you can follow step by step the development of android and iOS application using Kotlin Multiplatform:

👉 Codelab

👉 Source Code

👉 Presentation

About

KMP: A Multiplatform Triathlon

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published