Kotlin/Native and Multiplatform

In this course, you will be introduced to Kotlin/Native and build a Kotlin Multiplatform app that runs on both iOS and Android using shared Kotlin code. By Joe Howard.

Leave a rating/review
Save for later
Comments
Share

Who is this for?

This course is for mobile developers interested in learning how to introduce code-sharing between their iOS and Android app projects by leveraging the Kotlin/Native compiler and adopting the Kotlin Multiplatform approach.

You should be familiar with either iOS or Android development, and have at least some basic knowledge of developing for both of the platforms. You should also have experience with using the Kotlin language and be comfortable using the command line.

iOS developers new to Android and Kotlin will want to learn the basics of Android and Kotlin development prior to beginning the course.

Covered concepts

  • Kotlin/Native
  • Kotlin Multiplatform
  • Sharing code between iOS/Android
  • expect and actual keywords
  • Ktor client and Coroutines
  • Serialization
  • AppCode for Multiplatform

Part 1: Getting Started with Kotlin/Native

01
Toggle description

Welcome to the Kotlin / Native for iOS video course! In this introduction, find out what the course will cover.

Toggle description

We'll give more precise definitions of Kotlin/Native and Kotlin Multiplatform, and look at how they allow you to share code across iOS and Android.

Toggle description

Install the Kotlin/Native compiler Konan on macOS, and contrast it with the kotlin-jvm compiler installed using Homebrew.

Toggle description

Write your first Kotlin program for the command-line on macOS, and add code that utilizes the Kotlin standard library.

Toggle description

Test your knowledge of how to compile code using Kotlin/Native through a hands-on challenge, writing a Kotlin/Native program on your own.

Toggle description

Compare writing a program using Kotlin/Native with writing a Kotlin script that is run using the kotlin-JVM compiler, through a hands-on challenge.

Toggle description

Get an introduction to the Integrated Development Environments that we will use in the course, including Android Studio, Xcode, and AppCode.

Conclusion 1:31
Toggle description

Review all that you've done in Part 1 of the course, and take a look ahead at where we'll be going in Part 2 on Kotlin Multiplatform.

Part 2: Multiplatform and Shared Code

Toggle description

See what we'll be covering in Part 2, and learn about the advantages that Kotlin Multiplatform provides over the typical app development process.

Toggle description

Use Android Studio to create the root project and Android project for the Multiplatform app, and set up the shared project at the command-line by hand.

Toggle description

Write the Gradle build script that determines how to compile the shared code into a jar file for use on Android and a framework file for use on iOS.

Toggle description

Use the Kotlin expect keyword to define an interface that can be used in the shared code and the actual keyword to provide platform-dependent implementations.

Toggle description

Include the shared project in the Android app as a dependency, and access the shared module from the Android code.

Toggle description

Use Xcode to create the iOS project for the Kotlin Multiplatform app, and update the build script of the shared project for integration with Xcode.

Toggle description

Add a label to the main iOS storyboard, and update the iOS project to use the shared framework to display a greeting in the label.

Toggle description

Test your understanding of the set up of the shared code by modifying the output produced on iOS, and build the shared project from Xcode.

Conclusion 1:36
Toggle description

Review all that you've done in Parts 1 and 2 of the course, and take a look ahead at where we'll be going in Part 3.

Part 3: Networking, Concurrency, and Serialization

Toggle description

See what we'll be covering in Part 3 of the course, adding networking, concurrency, and serialization into the Multiplatform app.

Toggle description

Use the ktor-client and Kotlin coroutines to add an API class to the project for making a network call to the GitHub API.

Toggle description

Get introduced to CoroutineContext, Dispatchers, CoroutineScope, and coroutine builders, and use them to create a base presenter class in the shared module.

Toggle description

Define a Model-View-Presenter structure within the Multiplatform app, including a data repository which presenters will query for data to send to the view.

Toggle description

Implement the MVP view interface in the Android app code, and show the data from the shared network call in the Android app.

Toggle description

Implement the MVP view interface in the iOS app code, and show the data from the shared network call in the Xcode console.

Toggle description

Use the kotlinx.serialization library to add JSON deserialization into the shared project, and turn the network JSON response into a list of Kotlin instances.

Toggle description

Update the Android app to add a RecyclerView to display the list of data that is provided by the shared presenter.

The iOS UI 9:58
Toggle description

Update the iOS app to add a UITableView to display the list of data that is provided by the shared presenter.

Conclusion 1:59
Toggle description

Review all that we've done in Parts 2 and 3 of the course to create shared code that can be used on iOS and Android, and take at where we'll be going in Part 4.

Part 4: AppCode, Debugging, and Gotchas

Toggle description

See what we'll be covering in Part 4 of the course on AppCode, Multiplatform debugging, and Gotchas you may run into in a Kotlin Multiplatform project.

Toggle description

Use AppCode to create a macOS command-line project, and redo the small program we wrote in Part 1 of the course.

Toggle description

See how AppCode can be used to write an iOS app using Kotlin instead of Swift, and learn about pros and cons of this approach.

Debugging 2:39
Toggle description

See a brief demonstration of what debugging looks like when developing a Kotlin Multiplatform app using IDEs like Android Studio and Xcode.

Gotchas 3:56
Toggle description

Review the various risks that you take when embarking on a Kotlin Multiplatform project, and see other potential gotchas that you may run into.

Conclusion 5:02
Toggle description

See a summary of the important benefits that Kotlin/Native and Multiplatform offer you, and then review the course and take a look at where to go from here.