Updating the skills of new Android developers with what they need to start their first application in Kotlin and update their knowledge with Google I/O 2018 latest update announcement.
%in Midrand+277-882-255-28 abortion pills for sale in midrand
Intro to kotlin 2018
1. The State of Kotlin 2018
Prepared by Shady Selim
facebook.com/Kotlin.Cairo
+
2. Speaker Bio
• Official Google Speaker
• GDG Helwan Founder & Leader
• Kotlin Cairo User Group Founder
• Mentor and tester in Udacity Nanodegree
• Mobile & Web Evangelist
• Technology savvy
• Think tank
• UI/UX freak
linkedin.com/in/ShadySelim/
@dr_Shady_Selim
+
3. Kotlin History
• Created by Jetbrains on 2011
• Open sourced on 2012
• Reached version 1 on 2016
• Adopted by Google on 2017
+
5. 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
+
6. Kotlin Strengths
• 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
+
7. Kotlin Strengths
+
• Extensions
• Anko (Commons, Layouts, SQLite, & Coroutines)
• No new
• No semi colon
• Smart casting
• Great IDE and tooling supports
• Variables (val vs. var)
• Functional and OOP paradigm
12. Kotlin Data Class
+
• Provides a Customer class with the following functionality:
• getters (and setters in case of vars) for all properties
• equals()
• hashCode()
• toString()
• copy()
• component1(), component2(), …, for all properties (see Data classes)
14. Switch Case (aka: Instance Checks)
+
when (x) {
is Foo -> ...
is Bar -> ...
else -> ...
}
15. For Loop (aka: Ranges)
+
for (i in 1..100) { ... } // closed range: includes 100
for (i in 1 until 100) { ... } // half-open range: does not include 100
for (x in 2..10 step 2) { ... }
for (x in 10 downTo 1) { ... }
if (x in 1..10) { ... }
18. If not null shorthand
+
val files = File("Test").listFiles()
println(files?.size)
What if want to not accept null and throw exception in case of Null?
println(files!!.size)
19. If not null and else shorthand
+
val files = File("Test").listFiles()
println(files?.size ?: "empty")
Executing a statement if null
val values = ...
val email = values["email"] ?: throw IllegalStateException("Email is missing!")
20. Calling multiple methods on an object
+
class Turtle {
fun penDown()
fun penUp()
fun turn(degrees: Double)
fun forward(pixels: Double)
}
val myTurtle = Turtle()
with(myTurtle) { //draw a 100 pix square
penDown()
for(i in 1..4) {
forward(100.0)
turn(90.0)
}
penUp()
}
21. What's new in Android (Google I/O '18)
+
youtube.com/watch?v=eMHsnvhcf78&list=PLVVyfDfMc59tyEmN_V1Gv9imR8Ujld1MW&index=4
min 7 , sec 22
22. Modern Android development: Android Jetpack,
Kotlin, and more (Google I/O 2018)
+
youtube.com/watch?v=IrMw7MEgADk&list=PLVVyfDfMc59tyEmN_V1Gv9imR8Ujld1MW&index=9
min 16 , sec 12
23. Android KTX
+
A set of Kotlin extensions for Android app development. The
goal of Android KTX is to make Android development with
Kotlin more concise, pleasant, and idiomatic by leveraging
the features of the language such as extension
functions/properties, lambdas, named parameters, and
parameter defaults. It is an explicit goal of this project to not
add any new features to the existing Android APIs.
github.com/android/android-ktx/