From the course: Kotlin Multiplatform Libraries
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Adding platform-specific implementations - Kotlin Tutorial
From the course: Kotlin Multiplatform Libraries
Adding platform-specific implementations
- [Instructor] Before we start coding, a quick reminder. If you ever find yourself stuck or out of sync with a code from the previous video, don't worry. You can always check out the Git branch that matches the video that you are watching. In this case, it's 03_02. Every video that involves code has its own branch. Those branches serve as starting points, so feel free to jump in at any time. And now, let's talk about platform-specific code. Sometimes your shared code needs to reach into platform-specific APIs. But before you roll up your sleeves and start writing that yourself, always check if there is already a Kotlin Multiplatform library that provides what you need. There are a few websites that list KMP libraries along with the platforms that they support. One of my favorites is klibs.io. Here, if you, for example, need to get the current time from a device, you could write that code manually for each target. But you might also find that JetBrains already provides a library that…