SlideShare a Scribd company logo
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
What
Why
Who
When
Where
How
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
Why share code?
• DRY
• same code/logic for different platforms
• productivity, features, less bugs, more platforms
Why share code?
• crossplatform in the past
• networking library in C
• Windows Mobile
• Windows
• Android
• Linux
Why share code?
• sharing entire components
• JVM servers can share business logic with Android apps
• All client apps share similar logic and features
Kotlin Multiplatfom In Action
Why share code?
• Mobile platforms share a
lot in common
Why NOT share code?
• Performance
• Slower innovation
• shared UI
• All or nothing
• Vendor lock-in
• Future
• Bugs/lack of features
Why use Kotlin Multiplatform?
• modern, industrial language
• similar to swift, easy for java devs to learn
• great tooling, ecosystem and community
• open-source
• write once, run native everywhere
Why use Kotlin Multiplatform?
• doesn’t limit you to subset of all platforms
• native access to entire platform API from Kotlin
• each platform get native, optimized binary
• fix bug once, for all platforms
• interoperability
• optional sharing
Why use Kotlin Multiplatform?
optional sharing
Why not other solutions?
• Flutter, React Native, Xamarin
• not same usecase
• sharing UI - risky
• new language, new tools, new libs
• accessing platform APIs is hard, bridges
• frameworks
Kotlin Multiplatfom In Action
Why not other solutions?
“Anything that requires you to make large decisions and
potentially large rewrites, perform large retrainings and
rehirings, or anything that has to share UI or doesn’t work well
with a native platform is, well, very risky.” - Kevin Galligan,
Touchlab
Kotlin Multiplatfom In Action
JetBrains
• Coroutines
• Ktor
• kotlinx.serialization
• SQLDelight
• okio
• okhttp?
Touchlab
• Stately
Kotlin Multiplatfom In Action
How to start?
• Android Studio
• InteliJ IDEA
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
Expect/actual
declare expected class/fun/property in common code
actually implement in platform-specific code
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
Kotlin/Native
• iOS, Linux, Windows, MacOS, WebAssembly...
• build full apps or libs
• access to native platform APIs
• interoperable with C/ObjC(/Swift)
• Kotlin can call C/ObjC/Swift and vice-versa
• Kotlin can extend ObjC/Swift classes and vice-versa
Concurrency is hard
• languages/runtimes allow unsafe concurrency
• tools - locks & volatile
• no warnings
• deadlocks
• entire burden on devs
• no guaranties of safety
• bugs leak into production
Saner concurrency
• new, stricter memory model
• ARC with cycle collector
• 2 simple rules
• Immutable state can be shared among threads
• Mutable data belongs to one thread
• compiler and runtime check the rules
• thread-safe code
Saner concurrency
+GC per thread, no suspends
+shared reference counter with swift
-no global mutable state
-new concepts, patterns, practices
-coroutines
Saner concurrency
• Any.freeze()
• passing mutable data by detaching
• No manual concurrency management
• Workers
• Atomics - AtomicRef/Int/Long/...
• “Stranger threads” (link in resources)
Saner concurrency
• work in progress
• multithreaded coroutines
• similar rules for JVM
• relaxed memory model
Kotlin Multiplatfom In Action
Status
• beta but relatively stable
• low-risk
• production
• large projects - wait for release
• smaller projects - maybe
• part of a project - yesterday
Kotlin Multiplatfom In Action
resources: cutt.ly/kmp-ns
email: mmitic89@outlook.com
android-serbia slack: @Marko Mitić
kotlinlang slack: @Marko Mitic
Ad

More Related Content

What's hot (20)

Robot Framework with actual robot
Robot Framework with actual robot Robot Framework with actual robot
Robot Framework with actual robot
Eficode
 
Coding in kotlin
Coding in kotlinCoding in kotlin
Coding in kotlin
Debmalya Jash
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
SMNajrulHowlader
 
Chapter 1 java
Chapter 1 java Chapter 1 java
Chapter 1 java
Ahmad sohail Kakar
 
Azure at the command line
Azure at the command lineAzure at the command line
Azure at the command line
Ravikanth Chaganti
 
Jenkins-Koji plugin presentation on Python & Ruby devel group @ Brno
Jenkins-Koji plugin presentation on Python & Ruby devel group @ BrnoJenkins-Koji plugin presentation on Python & Ruby devel group @ Brno
Jenkins-Koji plugin presentation on Python & Ruby devel group @ Brno
Vaclav Tunka
 
Docker: Fire your Sysadmin and use Docker to build, ship and run any app, any...
Docker: Fire your Sysadmin and use Docker to build, ship and run any app, any...Docker: Fire your Sysadmin and use Docker to build, ship and run any app, any...
Docker: Fire your Sysadmin and use Docker to build, ship and run any app, any...
Phil Reither
 
The Beam Vision for Portability: "Write once run anywhere"
The Beam Vision for Portability: "Write once run anywhere"The Beam Vision for Portability: "Write once run anywhere"
The Beam Vision for Portability: "Write once run anywhere"
Knoldus Inc.
 
Infinum iOS Talks #2 - Xamarin by Ivan Đikić
Infinum iOS Talks #2 - Xamarin by Ivan ĐikićInfinum iOS Talks #2 - Xamarin by Ivan Đikić
Infinum iOS Talks #2 - Xamarin by Ivan Đikić
Infinum
 
Building a Language Server for Eclipse MicroProfile
Building a Language Server for Eclipse MicroProfileBuilding a Language Server for Eclipse MicroProfile
Building a Language Server for Eclipse MicroProfile
YK Chang
 
The tools & technologies behind Resin.io
The tools & technologies behind Resin.ioThe tools & technologies behind Resin.io
The tools & technologies behind Resin.io
GreeceJS
 
Docker Practical Use Cases
Docker Practical Use CasesDocker Practical Use Cases
Docker Practical Use Cases
Alexei Yuzhakov
 
Landscape of Eclipse MicroProfile Tools
Landscape of Eclipse MicroProfile ToolsLandscape of Eclipse MicroProfile Tools
Landscape of Eclipse MicroProfile Tools
YK Chang
 
Functional solid
Functional solidFunctional solid
Functional solid
Alexandr Sugak
 
Functional Solid, Aleksandr Sugak
Functional Solid, Aleksandr SugakFunctional Solid, Aleksandr Sugak
Functional Solid, Aleksandr Sugak
Sigma Software
 
Introduction to Phoenix Web Framework
Introduction to Phoenix Web FrameworkIntroduction to Phoenix Web Framework
Introduction to Phoenix Web Framework
Riza Fahmi
 
CLI, SDK, Doc... What if we generate them?
CLI, SDK, Doc... What if we generate them?CLI, SDK, Doc... What if we generate them?
CLI, SDK, Doc... What if we generate them?
Scaleway
 
Javantura v4 - Self-service app deployment with Kubernetes and OpenShift - Ma...
Javantura v4 - Self-service app deployment with Kubernetes and OpenShift - Ma...Javantura v4 - Self-service app deployment with Kubernetes and OpenShift - Ma...
Javantura v4 - Self-service app deployment with Kubernetes and OpenShift - Ma...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Guided overview of software frameworks qt framework
Guided overview of software frameworks   qt frameworkGuided overview of software frameworks   qt framework
Guided overview of software frameworks qt framework
Benjamin Cottrell
 
Better Swift from the Foundation up #tryswiftnyc17 09-06
Better Swift from the Foundation up #tryswiftnyc17 09-06Better Swift from the Foundation up #tryswiftnyc17 09-06
Better Swift from the Foundation up #tryswiftnyc17 09-06
Carl Brown
 
Robot Framework with actual robot
Robot Framework with actual robot Robot Framework with actual robot
Robot Framework with actual robot
Eficode
 
Jenkins-Koji plugin presentation on Python & Ruby devel group @ Brno
Jenkins-Koji plugin presentation on Python & Ruby devel group @ BrnoJenkins-Koji plugin presentation on Python & Ruby devel group @ Brno
Jenkins-Koji plugin presentation on Python & Ruby devel group @ Brno
Vaclav Tunka
 
Docker: Fire your Sysadmin and use Docker to build, ship and run any app, any...
Docker: Fire your Sysadmin and use Docker to build, ship and run any app, any...Docker: Fire your Sysadmin and use Docker to build, ship and run any app, any...
Docker: Fire your Sysadmin and use Docker to build, ship and run any app, any...
Phil Reither
 
The Beam Vision for Portability: "Write once run anywhere"
The Beam Vision for Portability: "Write once run anywhere"The Beam Vision for Portability: "Write once run anywhere"
The Beam Vision for Portability: "Write once run anywhere"
Knoldus Inc.
 
Infinum iOS Talks #2 - Xamarin by Ivan Đikić
Infinum iOS Talks #2 - Xamarin by Ivan ĐikićInfinum iOS Talks #2 - Xamarin by Ivan Đikić
Infinum iOS Talks #2 - Xamarin by Ivan Đikić
Infinum
 
Building a Language Server for Eclipse MicroProfile
Building a Language Server for Eclipse MicroProfileBuilding a Language Server for Eclipse MicroProfile
Building a Language Server for Eclipse MicroProfile
YK Chang
 
The tools & technologies behind Resin.io
The tools & technologies behind Resin.ioThe tools & technologies behind Resin.io
The tools & technologies behind Resin.io
GreeceJS
 
Docker Practical Use Cases
Docker Practical Use CasesDocker Practical Use Cases
Docker Practical Use Cases
Alexei Yuzhakov
 
Landscape of Eclipse MicroProfile Tools
Landscape of Eclipse MicroProfile ToolsLandscape of Eclipse MicroProfile Tools
Landscape of Eclipse MicroProfile Tools
YK Chang
 
Functional Solid, Aleksandr Sugak
Functional Solid, Aleksandr SugakFunctional Solid, Aleksandr Sugak
Functional Solid, Aleksandr Sugak
Sigma Software
 
Introduction to Phoenix Web Framework
Introduction to Phoenix Web FrameworkIntroduction to Phoenix Web Framework
Introduction to Phoenix Web Framework
Riza Fahmi
 
CLI, SDK, Doc... What if we generate them?
CLI, SDK, Doc... What if we generate them?CLI, SDK, Doc... What if we generate them?
CLI, SDK, Doc... What if we generate them?
Scaleway
 
Guided overview of software frameworks qt framework
Guided overview of software frameworks   qt frameworkGuided overview of software frameworks   qt framework
Guided overview of software frameworks qt framework
Benjamin Cottrell
 
Better Swift from the Foundation up #tryswiftnyc17 09-06
Better Swift from the Foundation up #tryswiftnyc17 09-06Better Swift from the Foundation up #tryswiftnyc17 09-06
Better Swift from the Foundation up #tryswiftnyc17 09-06
Carl Brown
 

Similar to Kotlin Multiplatfom In Action (20)

Native App Development for iOS, Android, and Windows with Visual Studio
Native App Development for iOS, Android, and Windows with Visual StudioNative App Development for iOS, Android, and Windows with Visual Studio
Native App Development for iOS, Android, and Windows with Visual Studio
Xamarin
 
Portable Class Library Deep Dive
Portable Class Library Deep DivePortable Class Library Deep Dive
Portable Class Library Deep Dive
James Montemagno
 
Cross Platform Development in C# (DDDNorth 2013)
Cross Platform Development in C# (DDDNorth 2013)Cross Platform Development in C# (DDDNorth 2013)
Cross Platform Development in C# (DDDNorth 2013)
ross.dargan
 
C# everywhere: Xamarin and cross platform development
C# everywhere: Xamarin and cross platform developmentC# everywhere: Xamarin and cross platform development
C# everywhere: Xamarin and cross platform development
Gill Cleeren
 
Future of Kotlin - How agile can language development be?
Future of Kotlin - How agile can language development be?Future of Kotlin - How agile can language development be?
Future of Kotlin - How agile can language development be?
Andrey Breslav
 
Building a Cross-Platform Mobile SDK in Rust.pdf
Building a Cross-Platform Mobile SDK in Rust.pdfBuilding a Cross-Platform Mobile SDK in Rust.pdf
Building a Cross-Platform Mobile SDK in Rust.pdf
IanWagner13
 
The Architect Way
The Architect WayThe Architect Way
The Architect Way
Jan Jongboom
 
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
NETWAYS
 
Why Kotlin?
Why Kotlin?Why Kotlin?
Why Kotlin?
Yongqiang Li
 
NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET
Dmytro Mindra
 
Go: What's Different ?
Go: What's Different ?Go: What's Different ?
Go: What's Different ?
Tarun Vashisth
 
Starting from scratch in 2017
Starting from scratch in 2017Starting from scratch in 2017
Starting from scratch in 2017
Stefano Bonetta
 
Italian Alt.Net Conference MonoTouch Session
Italian Alt.Net Conference MonoTouch SessionItalian Alt.Net Conference MonoTouch Session
Italian Alt.Net Conference MonoTouch Session
Chris Hardy
 
Introduction to xamarin
Introduction to xamarin  Introduction to xamarin
Introduction to xamarin
Sumantro Mukherjee
 
ITB2024 - Keynote Day 1 - Ortus Solutions.pdf
ITB2024 - Keynote Day 1 - Ortus Solutions.pdfITB2024 - Keynote Day 1 - Ortus Solutions.pdf
ITB2024 - Keynote Day 1 - Ortus Solutions.pdf
Ortus Solutions, Corp
 
Titanium: Native Mobile Apps with Javascript
Titanium: Native Mobile Apps with Javascript Titanium: Native Mobile Apps with Javascript
Titanium: Native Mobile Apps with Javascript
Leonardo Farias
 
Introduction to xamarin
Introduction to xamarinIntroduction to xamarin
Introduction to xamarin
Prabhat gangwar
 
Titanium appcelerator kickstart
Titanium appcelerator kickstartTitanium appcelerator kickstart
Titanium appcelerator kickstart
Alessio Ricco
 
ECE-3567-Lecture-1-Spring-2025 for beginner
ECE-3567-Lecture-1-Spring-2025 for beginnerECE-3567-Lecture-1-Spring-2025 for beginner
ECE-3567-Lecture-1-Spring-2025 for beginner
MahmoudElsamanty
 
Radu vunvulea building and testing windows 8 metro style applications using ...
Radu vunvulea  building and testing windows 8 metro style applications using ...Radu vunvulea  building and testing windows 8 metro style applications using ...
Radu vunvulea building and testing windows 8 metro style applications using ...
Radu Vunvulea
 
Native App Development for iOS, Android, and Windows with Visual Studio
Native App Development for iOS, Android, and Windows with Visual StudioNative App Development for iOS, Android, and Windows with Visual Studio
Native App Development for iOS, Android, and Windows with Visual Studio
Xamarin
 
Portable Class Library Deep Dive
Portable Class Library Deep DivePortable Class Library Deep Dive
Portable Class Library Deep Dive
James Montemagno
 
Cross Platform Development in C# (DDDNorth 2013)
Cross Platform Development in C# (DDDNorth 2013)Cross Platform Development in C# (DDDNorth 2013)
Cross Platform Development in C# (DDDNorth 2013)
ross.dargan
 
C# everywhere: Xamarin and cross platform development
C# everywhere: Xamarin and cross platform developmentC# everywhere: Xamarin and cross platform development
C# everywhere: Xamarin and cross platform development
Gill Cleeren
 
Future of Kotlin - How agile can language development be?
Future of Kotlin - How agile can language development be?Future of Kotlin - How agile can language development be?
Future of Kotlin - How agile can language development be?
Andrey Breslav
 
Building a Cross-Platform Mobile SDK in Rust.pdf
Building a Cross-Platform Mobile SDK in Rust.pdfBuilding a Cross-Platform Mobile SDK in Rust.pdf
Building a Cross-Platform Mobile SDK in Rust.pdf
IanWagner13
 
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
NETWAYS
 
NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET
Dmytro Mindra
 
Go: What's Different ?
Go: What's Different ?Go: What's Different ?
Go: What's Different ?
Tarun Vashisth
 
Starting from scratch in 2017
Starting from scratch in 2017Starting from scratch in 2017
Starting from scratch in 2017
Stefano Bonetta
 
Italian Alt.Net Conference MonoTouch Session
Italian Alt.Net Conference MonoTouch SessionItalian Alt.Net Conference MonoTouch Session
Italian Alt.Net Conference MonoTouch Session
Chris Hardy
 
ITB2024 - Keynote Day 1 - Ortus Solutions.pdf
ITB2024 - Keynote Day 1 - Ortus Solutions.pdfITB2024 - Keynote Day 1 - Ortus Solutions.pdf
ITB2024 - Keynote Day 1 - Ortus Solutions.pdf
Ortus Solutions, Corp
 
Titanium: Native Mobile Apps with Javascript
Titanium: Native Mobile Apps with Javascript Titanium: Native Mobile Apps with Javascript
Titanium: Native Mobile Apps with Javascript
Leonardo Farias
 
Titanium appcelerator kickstart
Titanium appcelerator kickstartTitanium appcelerator kickstart
Titanium appcelerator kickstart
Alessio Ricco
 
ECE-3567-Lecture-1-Spring-2025 for beginner
ECE-3567-Lecture-1-Spring-2025 for beginnerECE-3567-Lecture-1-Spring-2025 for beginner
ECE-3567-Lecture-1-Spring-2025 for beginner
MahmoudElsamanty
 
Radu vunvulea building and testing windows 8 metro style applications using ...
Radu vunvulea  building and testing windows 8 metro style applications using ...Radu vunvulea  building and testing windows 8 metro style applications using ...
Radu vunvulea building and testing windows 8 metro style applications using ...
Radu Vunvulea
 
Ad

Recently uploaded (20)

Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
Lynda Kane
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Learn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step GuideLearn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step Guide
Marcel David
 
"PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System""PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System"
Jainul Musani
 
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from AnywhereAutomation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Lynda Kane
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Datastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptxDatastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
kaleeswaric3
 
"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko
Fwdays
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Image processinglab image processing image processing
Image processinglab image processing  image processingImage processinglab image processing  image processing
Image processinglab image processing image processing
RaghadHany
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical DebtBuckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Lynda Kane
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your UsersAutomation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Lynda Kane
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
Lynda Kane
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Learn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step GuideLearn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step Guide
Marcel David
 
"PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System""PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System"
Jainul Musani
 
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from AnywhereAutomation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Lynda Kane
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Datastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptxDatastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
kaleeswaric3
 
"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko
Fwdays
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Image processinglab image processing image processing
Image processinglab image processing  image processingImage processinglab image processing  image processing
Image processinglab image processing image processing
RaghadHany
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical DebtBuckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Lynda Kane
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your UsersAutomation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Lynda Kane
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Ad

Kotlin Multiplatfom In Action

  • 7. Why share code? • DRY • same code/logic for different platforms • productivity, features, less bugs, more platforms
  • 8. Why share code? • crossplatform in the past • networking library in C • Windows Mobile • Windows • Android • Linux
  • 9. Why share code? • sharing entire components • JVM servers can share business logic with Android apps • All client apps share similar logic and features
  • 11. Why share code? • Mobile platforms share a lot in common
  • 12. Why NOT share code? • Performance • Slower innovation • shared UI • All or nothing • Vendor lock-in • Future • Bugs/lack of features
  • 13. Why use Kotlin Multiplatform? • modern, industrial language • similar to swift, easy for java devs to learn • great tooling, ecosystem and community • open-source • write once, run native everywhere
  • 14. Why use Kotlin Multiplatform? • doesn’t limit you to subset of all platforms • native access to entire platform API from Kotlin • each platform get native, optimized binary • fix bug once, for all platforms • interoperability • optional sharing
  • 15. Why use Kotlin Multiplatform? optional sharing
  • 16. Why not other solutions? • Flutter, React Native, Xamarin • not same usecase • sharing UI - risky • new language, new tools, new libs • accessing platform APIs is hard, bridges • frameworks
  • 18. Why not other solutions? “Anything that requires you to make large decisions and potentially large rewrites, perform large retrainings and rehirings, or anything that has to share UI or doesn’t work well with a native platform is, well, very risky.” - Kevin Galligan, Touchlab
  • 20. JetBrains • Coroutines • Ktor • kotlinx.serialization
  • 21. • SQLDelight • okio • okhttp? Touchlab • Stately
  • 23. How to start? • Android Studio • InteliJ IDEA
  • 31. Expect/actual declare expected class/fun/property in common code actually implement in platform-specific code
  • 35. Kotlin/Native • iOS, Linux, Windows, MacOS, WebAssembly... • build full apps or libs • access to native platform APIs • interoperable with C/ObjC(/Swift) • Kotlin can call C/ObjC/Swift and vice-versa • Kotlin can extend ObjC/Swift classes and vice-versa
  • 36. Concurrency is hard • languages/runtimes allow unsafe concurrency • tools - locks & volatile • no warnings • deadlocks • entire burden on devs • no guaranties of safety • bugs leak into production
  • 37. Saner concurrency • new, stricter memory model • ARC with cycle collector • 2 simple rules • Immutable state can be shared among threads • Mutable data belongs to one thread • compiler and runtime check the rules • thread-safe code
  • 38. Saner concurrency +GC per thread, no suspends +shared reference counter with swift -no global mutable state -new concepts, patterns, practices -coroutines
  • 39. Saner concurrency • Any.freeze() • passing mutable data by detaching • No manual concurrency management • Workers • Atomics - AtomicRef/Int/Long/... • “Stranger threads” (link in resources)
  • 40. Saner concurrency • work in progress • multithreaded coroutines • similar rules for JVM • relaxed memory model
  • 42. Status • beta but relatively stable • low-risk • production • large projects - wait for release • smaller projects - maybe • part of a project - yesterday
  • 44. resources: cutt.ly/kmp-ns email: [email protected] android-serbia slack: @Marko Mitić kotlinlang slack: @Marko Mitic

Editor's Notes

  • #6: What is Kotlin mutliplatform? One of the goals for Kotlin is being able to compile to and run on all platforms. 3 compiler backends - Kotlin/JVM, Kotlin/JS, Kotlin/Native - This, together with tools that facilitate efficient code sharing and projects targeting multiple platforms - KMP We'll talk more about multiplatform, but first - WHY
  • #8: DRY principle, avoid code duplication no need to write same code/logic for different platforms better productivity, more features, less bugs, reach more platforms
  • #9: Crossplatform in native world IKEv2 lib - windows & windows mobile, android, Linux With rise of VMs and new languages, no common code could serve all platforms
  • #10: Given proper architecture, sharing entire components can be relatively easy JVM servers can share business logic with Android apps All client apps share similar logic and features
  • #11: Spotify client apps - while frontend/UI differs from platform to platform features and logic behind are mostly identical it's easy to see how sharing code across platforms can be really benefitial for various usecases
  • #12: Mobile platforms share a lot in common Android & IOS apps tend to look similar, share identical features, same usacases, platforms have same capabilities and similar limitation app arhitectures are very similar if youre using some layered arhitecture like Clean arhitecure, your app might look like this Domain layer (business logic) is usually great candidate for sharing as it doesn't depend on frameworks and platform Data layer - works with identical data across platforms
  • #13: performance tend to suffer,VM, interpreters, script languages inovation slows down as advancements on one platform cant be used in shared solutions UI is limited to shared features, not as good as native enitire app must be written in given framework changing framework requires entire app rewrite will that framework even exist in 5-10 years? if we run into an issue or framework lacks needed feature, project goes back to starting point
  • #14: modern, industrial language similar to swift, easy for java devs to learn top tooling, great ecosystem and community write once, run native everywhere
  • #15: doesn’t limit you to subset of all platforms native access to entire platform API from Kotlin each platform get native, optimized binary fix bug once, for all platforms interoperability
  • #16: pick what you want to share, no need to decide on porting entire app pick easily shareable compoment, give it a try even if you don't want to continue using it, you have perfectly fine Android code low risk easy to adopt - easy to convince management - they care about risk
  • #17: sharing UI - risky - doesn't feel like native Flutter/ReactNative App using Flutter is Flutter app, app using RN is RN app, app using KMP is just an app - you can add KMP library/module without affecting app structure/framework. You can add two, three. You can add KMP lib to Flutter or RN app. - new language, new tools, new libs - issues are localized in KMP - framework vs library
  • #19: optional sharing - pick your adventure
  • #20: who's using or supporting KMP
  • #21: coroutines - great asynchronous programing ktor - Ktor is a framework for building asynchronous servers and clients you can build web servers with it and it also offers multiplatform network client you can use in your applications with ktor, you can write all your networking code once in common code and use that on all platforms serialization - offers reflection-less serialization of kotlin classes to JSON and binary formats uses a compiler plugin to generate code needed for serialization supports all platform - common code
  • #22: SQLDelight - DB library. SQLDelight generates typesafe APIs from your SQL statements. It compile-time verifies your schema, statements, and migrations and provides IDE features like autocomplete and refactoring which make writing and maintaining SQL simple. Multiplatform library, write all your DB code once in common code and use on all platforms okio - modern I/O library, okhttp okhttp - esential HTTP library for andoird devs, some people may know it as retrofit, which builds upon it. Rewriten in Kotlin, we might get multiplatform release in the future Touchlab - active in K/N developement, stately - concurrency in K/N,
  • #24: IDEA community edition - free Ultimate edition new project templates KMP templates - clone/fork from github write build script yourself
  • #25: target - target is a part of the build that is responsible for building, testing, and packaging a complete piece of software for one of the platforms
  • #27: current state of dependencies what if we wanted to add a server to the picture?
  • #28: we can improve - Android & iOS are both clients are we'll probably need some client-specific code that we wont need on server - clients sourceSet Android & server both run on JVM - maybe we can put some common dependencies and utilities in jvm sourceSet
  • #30: we added jvm target, with “server”sourceSet
  • #36: -> concurrency
  • #37: Traditionally languages allow (and promote) inherently unsafe concurrency Straighforward code is thread-unsafe by default Languages/runtime offer tools for handling concurrency However these tools haven't changed much since time of C - volatile & locks (synchronized) Languages do nothing to prevent or warn about issues, they are hard to detect Developers must find potential issues and implement safety themselves using given tools Overuse of misuse of concurrency tools lead to deadlocks Entire burden on devs There is no practically no guaranties of thread-safe code, testing just can’t reproduce some concurrency bugs and debugging doesn't help much Often these bugs leak into production In order to address this issue, Kotlin creators indroduced Saner concurrency
  • #38: Automatic Reference Counting
  • #40: freeze converts mutable state into immutable state, also all it's references, recursively Data can be manually detached from thread and passed to another one (memory leak) there's no synchronized/volatile, there's no need for them workers are threads that can execute tasks, execution returns future with task result atomic - way to bypass restrictions of memory model - they can be shared across threads although they hold mutable data