2 min read

New Starter Applications - KMM & Jetpack Compose

We continue to rework regularly our documentation website to bring you the best content for your Kotlin development. Today, I would like to zoom in on the Koin Quickstart applications, and the new added Compose and KMM starter projects.
New Starter Applications - KMM & Jetpack Compose
Based on picture from Dayne Topkin

Hello Koin users πŸ‘‹

We continue to rework regularly our documentation website to bring you the best content for your Kotlin development. Today, I would like to zoom in on the Koin Quickstart applications.

If you have not noticed, the Koin website contains a "Quickstart" section. This section is a list of quickstart tutorials to help you learn how to start Koin for a given technology use case.

Koin website - insert-koin.io

Revamping Starter Projects

Those projects were already existing since the beginning of Koin. For all the starter projects, we have finally reworked them to propose the same common data project to be exposed in different contexts. Β The idea is to have an easy comparison between technologies.

Koin Starter App - Android

We are sharing the main UserRepository component, to expose a list and find inside a collection of users. Those users' data will be exposed in Koin with different kinds of applications: Kotlin, Android ...

Those components are simple enough to not overwhelm you at the beginning of the project. Nevertheless, it's not too simplistic like just a "hello world" example.

Jetpack Compose Starter

We have a version of this Koin tutorial for Android Jetpack Compose available here: https://insert-koin.io/docs/quickstart/android-compose

This is a basic implementation of Compose state holder with UserStateHolder and a ViewModel component with UserViewModel:

You will see that the configuration is really trivial, and it's really to get started. Take a look at the project page for deeper details.

val appModule = module {
    singleOf(::UserRepositoryImpl) { bind<UserRepository>() }
    factoryOf(::UserStateHolder)
    viewModelOf(::UserViewModel)
}

Kotlin Multiplatform Mobile Starter

The other new starter project is the KMM starter project. It can be found at the following URL: https://insert-koin.io/docs/quickstart/kmm

The idea here is to have an Android app and an iOS app sharing the same common code. This common code (the UserRepository data components) will be used through:

  • KMPUserPresenter - a cross-platform presenter
  • AndroidUserViewModel - an Android user ViewModel
  • KMPUserPresenterHelper - iOS Kotlin helper to use KMPUserPresenter
Shared cross-platform presenter

All the shared code is setup to be used directly in both mobile applications.


We hope you'll enjoy those new projects. Feel free to give your feedback on Twitter: Β @insertkoin_io

Do not forget to subscribe to our blog to be sure to see all our fresh news!

See you πŸ‘‹