KEMBAR78
Kotlin native for iOS and Android | PDF
Kotlin/Native for iOS and Android
1
Presented By:
Shady Selim,
Senior Software Engineer
March 18th, 2020
● 20 years of experience in web and mobile development
● Official Google Speaker
● GDG Helwan & Kotlin Cairo User Group Founder & Leader
● Andela Senior Software Engineer
● Mentor in Udacity Nanodegree
● Mobile & Web Evangelist
● Technology savvy
● Think tank
● UI/UX freak
2
Speaker Bio
● Native iOS and Android Languages
● Cross Mobile Languages
● What is Kotlin?
● Jetpack Componse
● SwiftUI
● Kotlin/Native
3
Index
Swift Kotlin
Native iOS and Android Languages
OEM Widgets
Cupertino
Material Design
Canvas
Events
Location Bluetooth
Camera Sensors
Java
Kotlin
Swift
Objective-c
Application
Services
OEM SDKs
Cross Mobile Languages
6
Class A Class B
Popular Cross Tools
Web View
Canvas
Events
Location Bluetooth
Camera Sensors
JavaScript
HTML
CSS
Application
Services
Bridge
Class A
Canvas
Events
Location Bluetooth
Camera Sensors
Transferred
Native Code
Application
Services
FrameworklibrariesSDK
OEM Widgets
Cupertino
Material Design
Class B
Canvas
Events
Location Bluetooth
Camera Sensors
Native ARM
Binary
Code
Application
Services
Platform
Channels
Flutter Widgets
Cupertino
Material Design
Flutter Approach
So what is Flutter ?
Flutter is the next step in
App development
Speed and performance
Fast , smooth performance
Flexibility
Customize anything - Brand
first design
Native look and feel
Familiarity , ease of use
Rapid Development
Easy to learn , predictable
What is Kotlin?
12
Kotlin History
⬝ Created by Jetbrains on 2011
⬝ Open sourced on 2012
⬝ Reached version 1 on 2016
⬝ Adopted by Google on 2017
⬝ Google announce Kotlin as 1st Class language on 2017
⬝ Google announce Android Kotlin 1st language on 2019
Kotlin is
⬝ Statically typed programming language targeting the JVM
⬝ Support for functional and OO paradigms
⬝ Pragmatic, safe, concise, great Java interop
⬝ Free and open-source
⬝ Drastically reduces the amount of boilerplate code
⬝ Having Lambda expression
⬝ Avoids entire classes of errors such as null pointer exceptions
⬝ Supported by Google
Kotlin Strength
⬝ Modeling the data of your application concisely and expressively
⬝ Creating reusable abstractions using functional programming
techniques
⬝ Creating expressive domain-specific languages (DSL)
⬝ Java interop ensures that all existing Java frameworks can be used
⬝ No rewrite required to start using Kotlin in existing codebase
⬝ Existing investment is fully preserved
Jetpack Compose
16
Jetpack Compose
@Composable
fun Greeting(name: String) {
Text (text = "Hello $name!")
}
@Preview
@Composable
fun PreviewGreeting() {
Greeting("Android")
}
Jetpack Compose Benefits
⬝ Build with the benefits that Kotlin brings -- concise, safe, and fully
interoperable with the Java programming language. Designed to
drastically reduce the amount of boilerplate code you have to write,
so you can focus on your app code, and help avoid entire classes of
errors.
⬝ Fully declarative for defining UI components, including drawing and
creating custom layouts. Simply describe your UI as a set of
composable functions, and the framework handles UI optimizations
and updates to the view hierarchy under the hood.
Jetpack Compose Benefits -2
⬝ Provide reusable building blocks that let you build custom widgets
easier, and without starting from scratch.
⬝ Compatible with existing views so you can mix and match and adopt
at your own pace with direct access to all of the Android and
Jetpack APIs.
⬝ Material Design out of the box and animations from the start, so it’s
easy to create beautiful apps that are full of motion.
⬝ Accelerate development with tools like live preview and apply
changes.
SwiftUI
20
SwiftUI
SwiftUI Benefits
⬝ Declarative Syntax
⬝ Design Tools
⬝ Native on All Apple Platforms
⬝ Easy to read and natural to write
⬝ Works seamlessly with new Xcode design tools to keep your code
and design perfectly in sync
⬝ Automatic support for Dynamic Type, Dark Mode, localization, and
accessibility
Kotlin/Native
23
Kotlin/Native
⬝ An SDK, not a framework
⬝ Reuse your business logic
⬝ Smooth interoperability with platform-specific code
⬝ Have a native UI
⬝ No lagging behind native platforms
⬝ Use the language you already know and love
1 Code base,
2 platforms
Resources and samples
⬝ Main Page
https://www.jetbrains.com/lp/mobilecrossplatform/
⬝ Samples
https://github.com/JetBrains/kotlin-native/tree/master/samples
⬝ Minimal Projects
https://github.com/joreilly/PeopleInSpace
https://johnoreilly.dev/2019/06/08/swiftui-meetings-kotlin-multip
latform.html
⬝ MVVM Project Template
https://moko.icerock.dev/
Codelabs and Workshop
⬝ https://play.kotlinlang.org/hands-on/Targeting%20iOS%20and%20
Android%20with%20Kotlin%20Multiplatform/
⬝ https://www.raywenderlich.com/1022411-kotlin-multiplatform-pr
oject-for-android-and-ios-getting-started
28
Cairo, Egypt
Shady Yehia Selim
shady.selim@andela.com
/Shady-Selim
/ShadySelim
Senior Software Engineer
Interested in joining Andela, Apply here:
https://andela.com/JoinAndelaEgypt
⬝ Mercy Orangi
⬝ Reem Karara
3
0
Credits

Kotlin native for iOS and Android

  • 1.
    Kotlin/Native for iOSand Android 1 Presented By: Shady Selim, Senior Software Engineer March 18th, 2020
  • 2.
    ● 20 yearsof experience in web and mobile development ● Official Google Speaker ● GDG Helwan & Kotlin Cairo User Group Founder & Leader ● Andela Senior Software Engineer ● Mentor in Udacity Nanodegree ● Mobile & Web Evangelist ● Technology savvy ● Think tank ● UI/UX freak 2 Speaker Bio
  • 3.
    ● Native iOSand Android Languages ● Cross Mobile Languages ● What is Kotlin? ● Jetpack Componse ● SwiftUI ● Kotlin/Native 3 Index
  • 4.
    Swift Kotlin Native iOSand Android Languages
  • 5.
    OEM Widgets Cupertino Material Design Canvas Events LocationBluetooth Camera Sensors Java Kotlin Swift Objective-c Application Services OEM SDKs
  • 6.
  • 7.
    Class A ClassB Popular Cross Tools
  • 8.
    Web View Canvas Events Location Bluetooth CameraSensors JavaScript HTML CSS Application Services Bridge Class A
  • 9.
    Canvas Events Location Bluetooth Camera Sensors Transferred NativeCode Application Services FrameworklibrariesSDK OEM Widgets Cupertino Material Design Class B
  • 10.
    Canvas Events Location Bluetooth Camera Sensors NativeARM Binary Code Application Services Platform Channels Flutter Widgets Cupertino Material Design Flutter Approach
  • 11.
    So what isFlutter ? Flutter is the next step in App development Speed and performance Fast , smooth performance Flexibility Customize anything - Brand first design Native look and feel Familiarity , ease of use Rapid Development Easy to learn , predictable
  • 12.
  • 13.
    Kotlin History ⬝ Createdby Jetbrains on 2011 ⬝ Open sourced on 2012 ⬝ Reached version 1 on 2016 ⬝ Adopted by Google on 2017 ⬝ Google announce Kotlin as 1st Class language on 2017 ⬝ Google announce Android Kotlin 1st language on 2019
  • 14.
    Kotlin is ⬝ Staticallytyped programming language targeting the JVM ⬝ Support for functional and OO paradigms ⬝ Pragmatic, safe, concise, great Java interop ⬝ Free and open-source ⬝ Drastically reduces the amount of boilerplate code ⬝ Having Lambda expression ⬝ Avoids entire classes of errors such as null pointer exceptions ⬝ Supported by Google
  • 15.
    Kotlin Strength ⬝ Modelingthe data of your application concisely and expressively ⬝ Creating reusable abstractions using functional programming techniques ⬝ Creating expressive domain-specific languages (DSL) ⬝ Java interop ensures that all existing Java frameworks can be used ⬝ No rewrite required to start using Kotlin in existing codebase ⬝ Existing investment is fully preserved
  • 16.
  • 17.
    Jetpack Compose @Composable fun Greeting(name:String) { Text (text = "Hello $name!") } @Preview @Composable fun PreviewGreeting() { Greeting("Android") }
  • 18.
    Jetpack Compose Benefits ⬝Build with the benefits that Kotlin brings -- concise, safe, and fully interoperable with the Java programming language. Designed to drastically reduce the amount of boilerplate code you have to write, so you can focus on your app code, and help avoid entire classes of errors. ⬝ Fully declarative for defining UI components, including drawing and creating custom layouts. Simply describe your UI as a set of composable functions, and the framework handles UI optimizations and updates to the view hierarchy under the hood.
  • 19.
    Jetpack Compose Benefits-2 ⬝ Provide reusable building blocks that let you build custom widgets easier, and without starting from scratch. ⬝ Compatible with existing views so you can mix and match and adopt at your own pace with direct access to all of the Android and Jetpack APIs. ⬝ Material Design out of the box and animations from the start, so it’s easy to create beautiful apps that are full of motion. ⬝ Accelerate development with tools like live preview and apply changes.
  • 20.
  • 21.
  • 22.
    SwiftUI Benefits ⬝ DeclarativeSyntax ⬝ Design Tools ⬝ Native on All Apple Platforms ⬝ Easy to read and natural to write ⬝ Works seamlessly with new Xcode design tools to keep your code and design perfectly in sync ⬝ Automatic support for Dynamic Type, Dark Mode, localization, and accessibility
  • 23.
  • 24.
    Kotlin/Native ⬝ An SDK,not a framework ⬝ Reuse your business logic ⬝ Smooth interoperability with platform-specific code ⬝ Have a native UI ⬝ No lagging behind native platforms ⬝ Use the language you already know and love
  • 25.
    1 Code base, 2platforms
  • 26.
    Resources and samples ⬝Main Page https://www.jetbrains.com/lp/mobilecrossplatform/ ⬝ Samples https://github.com/JetBrains/kotlin-native/tree/master/samples ⬝ Minimal Projects https://github.com/joreilly/PeopleInSpace https://johnoreilly.dev/2019/06/08/swiftui-meetings-kotlin-multip latform.html ⬝ MVVM Project Template https://moko.icerock.dev/
  • 27.
    Codelabs and Workshop ⬝https://play.kotlinlang.org/hands-on/Targeting%20iOS%20and%20 Android%20with%20Kotlin%20Multiplatform/ ⬝ https://www.raywenderlich.com/1022411-kotlin-multiplatform-pr oject-for-android-and-ios-getting-started
  • 28.
    28 Cairo, Egypt Shady YehiaSelim shady.selim@andela.com /Shady-Selim /ShadySelim Senior Software Engineer
  • 29.
    Interested in joiningAndela, Apply here: https://andela.com/JoinAndelaEgypt
  • 30.
    ⬝ Mercy Orangi ⬝Reem Karara 3 0 Credits