Kotlin Multiplatform Sample Save

A sample Kotlin Multiplatform project having native UI and shared bussiness logic on Android and iOS platforms.

Project README

KMM First Look

What is Kotlin Multiplatform (KMP)

  • Kotlin Multiplatform allows you to share your business logic on multiple platforms like android, iOS and native desktop applications and as a result reducing the amount of time required for development.

Now what is Kotlin Multiplatform Mobile (KMM) ?

  • Kotlin Multiplatform (KMP) and Kotlin Multiplatform Mobile (KMM) are not seperate technologies. You can think of Kotlin Multiplatform Mobile (KMM) as a subset of Kotlin Multiplatform (KMP) which primarily focuses on mobile features. Kotlin Multiplatform Mobile (KMM) uses the multiplatform capabilities of kotlin to share bussiness logic of iOS and Android apps.

Why Kotlin Multiplatform Mobile (KMM) ?

  • Using KMM we can write our business logic once and reuse that for both the platforms android and iOS. We only need to write our platform specific code wherever it's necessary for example to implement our native UI. Does that mean we can have a single application which can run on both Android and iOS app using KMM ? No KMM is specifically design to share only business logic and use native UI to have exact look and feel as simple Android or iOS app. So we still need to create seperate applications for both the platforms.

About this project.

This is a sample KMM project which tries to shares as much as code possible between Android and iOS.

Android App iOS App

Pre-requisites

  • Android Studio – version 4.2 or higher.
  • Xcode – version 11.3 or higher.
  • This app displays a list of movies using API from TMDB so you must have a valid api key from TMDB. (If you don't have one you can get it here :- https://www.themoviedb.org/documentation/api)

How to Run Android App :-

  • Open Android Studio

  • Add KMM Plugin from Android Studio -> Preferences -> Plugins -> MarketPlace -> Search for Kotlin Multiplatform Mobile -> Install and Restart Android Studio

  • Run app.

How to Run iOS App :-

  • Pretty Simple KMM allows you to run and debug your iOS App from Android Studio itself. Just switch from androidApp to iosApp in your run configurations menu. (Remember :- This app contains Pods so we need to install that from Terminal first before running iOS app from Android Studio or xCode)
  • If you are an Android Developer who wants to explore iOS App or a newbie in iOS development and got confused about how to work with pods, we got you covered! You can find everything about pods here : :- https://cocoapods.org/
  • Does that mean you can simply run iOS App without xCode or macOS machine ? No You still need a macOS , xCode (and Simulators) and command line tools installed on your machine to run your iOS App.
  • Also you can run this project with xCode.
  • Open iosApp folder from the project install pods with terminal open .xcworkspace and run your application.

Find this example useful? :heart:

Support it by joining stargazers for this repository. :star:

🤝 How to Contribute

Whether you're helping us fix bugs, improve the docs, or a feature request, we'd love to have you! :muscle:

Check out our Contributing Guide for ideas on contributing.

Bugs and Feedback

For bugs, feature requests, and discussion please use GitHub Issues.

LICENSE

This project is licensed under the MIT License - see the LICENSE file for details

Open Source Agenda is not affiliated with "Kotlin Multiplatform Sample" Project. README Source: SimformSolutionsPvtLtd/Kotlin-multiplatform-sample

Open Source Agenda Badge

Open Source Agenda Rating