Kotlin/Native and Multiplatform

Apr 2 2019 · Video Course (2 hrs, 38 mins) · Advanced

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.

4.9/5 9 Ratings · Leave a Rating

Version

  • Kotlin 1.3, Android 5.0, Studio 3.3.1

Getting Started with Kotlin/Native

Introduction

5:09 Free

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

1

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.

2

Installing Konan

4:34 Free

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

3

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

4

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

5

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.

6

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

7

Conclusion

1:31

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.

8

Multiplatform and Shared Code

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

9

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.

10

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.

11

expect and actual

5:34 Free

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.

12

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

13

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.

14

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.

15

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.

16

Conclusion

1:36

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.

17

Networking, Concurrency, and Serialization

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

18

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

19

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

20

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.

21

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

22

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

23

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.

24

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

25

The iOS UI

9:58

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

26

Conclusion

1:59

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.

27

AppCode, Debugging, and Gotchas

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.

28

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

29

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.

30

Debugging

2:39

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

31

Gotchas

3:56

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

32

Conclusion

5:02

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.

33

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

Contributors

Comments