Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kotlin for Android

Kotlin for Android

Kotlin for Android is now officially supported by Google, in this presentation we explore some of the cool features of the language. Also, we take some time to introduce new-comers to Android Development.

Jorge E. Hernández

June 26, 2018
Tweet

More Decks by Jorge E. Hernández

Other Decks in Technology

Transcript

  1. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <school>
 <student name=“Juan”

    last_name=“Perez”/> <classroom name=“VIP Classroom”/> <teacher name=“El Barco”/> </school> // school_file.xml
  2. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <school>
 <student name=“Juan”

    last_name=“Perez”/> <classroom name=“VIP Classroom”/> <teacher name=“El Barco”/> </school> // school_file.xml <?xml version="1.0" encoding="utf-8"?> <library>
 </library>
 
 
 // library_file.xml
  3. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <library>
 <book
 name=“Fifty

    shades of Grey”/> <student
 name=“José García”/> <author
 name=“E. L. James”/> </library> <?xml version="1.0" encoding="utf-8"?> <school>
 <student name=“Juan” last_name=“Perez”/> <classroom name=“VIP Classroom”/> <teacher name=“El Barco”/> </school> // school_file.xml // library_file.xml
  4. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <library>
 <book
 name=“Fifty

    shades of Grey”/> <student
 name=“José García”/> <author
 name=“E. L. James”/> </library> <?xml version="1.0" encoding="utf-8"?> <school>
 <student name=“Juan” last_name=“Perez”/> <classroom name=“VIP Classroom”/> <teacher name=“El Barco”/> </school> // school_file.xml // library_file.xml
  5. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <library>
 <book
 name=“Fifty

    shades of Grey”/> <student
 name=“José García”/> <author
 name=“E. L. James”/> </library> <?xml version="1.0" encoding="utf-8"?> <school>
 <student name=“Juan” last_name=“Perez”/> <classroom name=“VIP Classroom”/> <teacher name=“El Barco”/> </school> // school_file.xml // library_file.xml
  6. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <library>
 <book
 name=“Fifty

    shades of Grey”/> <student
 name=“José García”/> <author
 name=“E. L. James”/> </library> <?xml version="1.0" encoding="utf-8"?> <school
 xmlns:=““> <student name=“Juan” last_name=“Perez”/> <classroom name=“VIP Classroom”/> <teacher name=“El Barco”/> </school> // school_file.xml // library_file.xml
  7. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <library>
 <book
 name=“Fifty

    shades of Grey”/> <student
 name=“José García”/> <author
 name=“E. L. James”/> </library> <?xml version="1.0" encoding="utf-8"?> <school
 xmlns:s=““> <student name=“Juan” last_name=“Perez”/> <classroom name=“VIP Classroom”/> <teacher name=“El Barco”/> </school> // school_file.xml // library_file.xml
  8. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <library>
 <book
 name=“Fifty

    shades of Grey”/> <student
 name=“José García”/> <author
 name=“E. L. James”/> </library> <?xml version="1.0" encoding="utf-8"?> <school
 xmlns:s=“http://example.com/schema/myschool“> <student name=“Juan” last_name=“Perez”/> <classroom name=“VIP Classroom”/> <teacher name=“El Barco”/> </school> // school_file.xml // library_file.xml
  9. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <library>
 <book
 name=“Fifty

    shades of Grey”/> <student
 name=“José García”/> <author
 name=“E. L. James”/> </library> <?xml version="1.0" encoding="utf-8"?> <school
 xmlns:s=“http://example.com/schema/myschool“> <student s:name=“Juan” s:last_name=“Perez”/> <classroom s:name=“VIP Classroom”/> <teacher s:name=“El Barco”/> </school> // school_file.xml // library_file.xml
  10. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <library
 xmlns:l=“http://example.com/schema/mylibrary“> <book


    name=“Fifty shades of Grey”/> <student
 name=“José García”/> <author
 name=“E. L. James”/> </library> <?xml version="1.0" encoding="utf-8"?> <school
 xmlns:s=“http://example.com/schema/myschool“> <student s:name=“Juan” s:last_name=“Perez”/> <classroom s:name=“VIP Classroom”/> <teacher s:name=“El Barco”/> </school> // school_file.xml // library_file.xml
  11. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <library
 xmlns:l=“http://example.com/schema/mylibrary“> <book


    l:name=“Fifty shades of Grey”/> <student
 l:name=“José García”/> <author
 l:name=“E. L. James”/> </library> <?xml version="1.0" encoding="utf-8"?> <school
 xmlns:s=“http://example.com/schema/myschool“> <student s:name=“Juan” s:last_name=“Perez”/> <classroom s:name=“VIP Classroom”/> <teacher s:name=“El Barco”/> </school> // school_file.xml // library_file.xml
  12. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <library
 xmlns:miau=“http://example.com/schema/mylibrary“> <book


    miau:name=“Fifty shades of Grey”/> <student
 miau:name=“José García”/> <author
 miau:name=“E. L. James”/> </library> <?xml version="1.0" encoding="utf-8"?> <school
 xmlns:guau=“http://example.com/schema/myschool“> <student guau:name=“Juan” guau:last_name=“Perez”/> <classroom guau:name=“VIP Classroom”/> <teacher guau:name=“El Barco”/> </school> // school_file.xml // library_file.xml
  13. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <library
 xmlns:l=“http://example.com/schema/mylibrary“> <book


    l:name=“Fifty shades of Grey”/> <student
 l:name=“José García”/> <author
 l:name=“E. L. James”/> </library> <?xml version="1.0" encoding="utf-8"?> <school
 xmlns:s=“http://example.com/schema/myschool“> <student s:name=“Juan” s:last_name=“Perez”/> <classroom s:name=“VIP Classroom”/> <teacher s:name=“El Barco”/> </school> // school_file.xml // library_file.xml
  14. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton"/> </android.support.constraint.ConstraintLayout> // my_screen.xml
  15. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content"/> </android.support.constraint.ConstraintLayout> // my_screen.xml
  16. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </android.support.constraint.ConstraintLayout> // my_screen.xml
  17. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"/> </android.support.constraint.ConstraintLayout> // my_screen.xml
  18. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"/> </android.support.constraint.ConstraintLayout> // my_screen.xml
  19. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"/> <TextView /> </android.support.constraint.ConstraintLayout> // my_screen.xml
  20. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"/> <TextView android:id="@+id/myTextView"/> </android.support.constraint.ConstraintLayout> // my_screen.xml
  21. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"/> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </android.support.constraint.ConstraintLayout> // my_screen.xml
  22. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"/> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!"/> </android.support.constraint.ConstraintLayout> // my_screen.xml
  23. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"/> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textSize="56sp" /> </android.support.constraint.ConstraintLayout> // my_screen.xml
  24. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"/> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textSize="56sp" /> </android.support.constraint.ConstraintLayout> // my_screen.xml
  25. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"/> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" /> </android.support.constraint.ConstraintLayout> // my_screen.xml
  26. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"/> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" /> </android.support.constraint.ConstraintLayout> // my_screen.xml
  27. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"/> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" /> </android.support.constraint.ConstraintLayout> // my_screen.xml
  28. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"/> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" /> </android.support.constraint.ConstraintLayout> // my_screen.xml
  29. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"/> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" /> </android.support.constraint.ConstraintLayout> // my_screen.xml
  30. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"/> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> </android.support.constraint.ConstraintLayout> // my_screen.xml
  31. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"/> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> </android.support.constraint.ConstraintLayout> // my_screen.xml
  32. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me" app:layout_constraintBottom_toTopOf="@+id/myTextView"/> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> </android.support.constraint.ConstraintLayout> // my_screen.xml
  33. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me" app:layout_constraintBottom_toTopOf="@+id/myTextView"/> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> </android.support.constraint.ConstraintLayout> // my_screen.xml
  34. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me" app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> </android.support.constraint.ConstraintLayout> // my_screen.xml
  35. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me" app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> </android.support.constraint.ConstraintLayout> // my_screen.xml
  36. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

    android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me" app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> </android.support.constraint.ConstraintLayout> // my_screen.xml
  37. A 5 minutes introduction // my_screen.xml <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout

    xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me" app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> </android.support.constraint.ConstraintLayout>
  38. A 5 minutes introduction Android Tests: - Clicks (taps) -

    Swipes - Pinch (zoom) Instrumentation tests “Espresso”
  39. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <resources> <color name="red">#FF0000</color>

    <color name="green">#00FF00</color> <color name="blue">#0000FF</color> </resources>
  40. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <resources> <string name="btn_text">Click

    me</string> <string name="hello">Hello World!</string> </resources>
  41. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"

    android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me" app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> </android.support.constraint.ConstraintLayout>
  42. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"

    app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" />
  43. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"

    app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" />
  44. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"

    app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <?xml version="1.0" encoding="utf-8"?> <resources> <color name="red">#FF0000</color> <color name="green">#00FF00</color> <color name="blue">#0000FF</color> </resources>
  45. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"

    app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textColor=“@color/red" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <?xml version="1.0" encoding="utf-8"?> <resources> <color name="red">#FF0000</color> <color name="green">#00FF00</color> <color name="blue">#0000FF</color> </resources>
  46. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"

    app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textColor=“@color/red" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <?xml version="1.0" encoding="utf-8"?> <resources> <color name="red">#FF0000</color> <color name="green">#00FF00</color> <color name="blue">#0000FF</color> </resources>
  47. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"

    app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textColor=“@color/red" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" />
  48. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"

    app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textColor=“@color/red" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <?xml version="1.0" encoding="utf-8"?> <resources> <dimen name="btn_width">180dp</dimen> <dimen name="btn_height">100dp</dimen> </resources>
  49. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Click me"

    app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textColor=“@color/red" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <?xml version="1.0" encoding="utf-8"?> <resources> <dimen name="btn_width">180dp</dimen> <dimen name="btn_height">100dp</dimen> </resources>
  50. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width=“@dimen/btn_width" android:layout_height="wrap_content" android:text="Click me"

    app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textColor=“@color/red" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <?xml version="1.0" encoding="utf-8"?> <resources> <dimen name="btn_width">180dp</dimen> <dimen name="btn_height">100dp</dimen> </resources>
  51. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width=“@dimen/btn_width" android:layout_height="wrap_content" android:text="Click me"

    app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textColor=“@color/red" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <?xml version="1.0" encoding="utf-8"?> <resources> <dimen name="btn_width">180dp</dimen> <dimen name="btn_height">100dp</dimen> </resources>
  52. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width=“@dimen/btn_width" android:layout_height="wrap_content" android:text="Click me"

    app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textColor=“@color/red" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" />
  53. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width=“@dimen/btn_width" android:layout_height="wrap_content" android:text="Click me"

    app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textColor=“@color/red" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" />
  54. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width=“@dimen/btn_width" android:layout_height=“@dimen/btn_height” android:text="Click me"

    app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textColor=“@color/red" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" />
  55. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width=“@dimen/btn_width" android:layout_height=“@dimen/btn_height” android:text="Click me"

    app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textColor=“@color/red" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <?xml version="1.0" encoding="utf-8"?> <resources> <dimen name="btn_width">180dp</dimen> <dimen name=“btn_height">100dp</dimen> </resources>
  56. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width=“@dimen/btn_width" android:layout_height=“@dimen/btn_height” android:text="Click me"

    app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textColor=“@color/red" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" />
  57. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width=“@dimen/btn_width" android:layout_height=“@dimen/btn_height” android:text="Click me"

    app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textColor=“@color/red" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" />
  58. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width=“@dimen/btn_width" android:layout_height=“@dimen/btn_height” android:text="Click me"

    app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textColor=“@color/red" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <?xml version="1.0" encoding="utf-8"?> <resources> <string name="btn_text">Click me</string> <string name="hello">Hello World!</string> </resources>
  59. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width=“@dimen/btn_width" android:layout_height=“@dimen/btn_height” android:text=“Click me"

    app:layout_constraintBottom_toTopOf="@+id/myTextView" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textColor=“@color/red" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <?xml version="1.0" encoding="utf-8"?> <resources> <string name="btn_text">Click me</string> <string name="hello">Hello World!</string> </resources>
  60. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width=“@dimen/btn_width" android:layout_height=“@dimen/btn_height” android:text=“@string/btn_text“ app:layout_constraintBottom_toTopOf="@+id/myTextView"

    app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" android:textColor=“@color/red" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <?xml version="1.0" encoding="utf-8"?> <resources> <string name="btn_text">Click me</string> <string name="hello">Hello World!</string> </resources>
  61. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width=“@dimen/btn_width" android:layout_height=“@dimen/btn_height” android:text=“@string/btn_text“ app:layout_constraintBottom_toTopOf="@+id/myTextView"

    app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=“@string/hello“ android:textColor=“@color/red" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <?xml version="1.0" encoding="utf-8"?> <resources> <string name="btn_text">Click me</string> <string name=“hello">Hello World!</string> </resources>
  62. A 5 minutes introduction <Button android:id="@+id/myButton" android:layout_width=“@dimen/btn_width" android:layout_height=“@dimen/btn_height” android:text=“@string/btn_text“ app:layout_constraintBottom_toTopOf="@+id/myTextView"

    app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=“@string/hello“ android:textColor=“@color/red" android:textSize="56sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" />
  63. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <resources> <color name="red">#FF0000</color>

    <color name="green">#00FF00</color> <color name="blue">#0000FF</color> </resources> colors.xml
  64. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <resources> <color name="red">#FF0000</color>

    <color name="green">#00FF00</color> <color name="blue">#0000FF</color> </resources> colors.xml public final class R { public static final class color { }} }}
  65. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <resources> <color name="red">#FF0000</color>

    <color name="green">#00FF00</color> <color name="blue">#0000FF</color> </resources> colors.xml public final class R { public static final class color { }} }}
  66. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <resources> <color name="red">#FF0000</color>

    <color name="green">#00FF00</color> <color name="blue">#0000FF</color> </resources> colors.xml public final class R { public static final class color { public static final int red=0x7f050002; public static final int green=0x7f050003; public static final int blue=0x7f050004; }} }}
  67. A 5 minutes introduction <?xml version="1.0" encoding="utf-8"?> <resources> <color name="red">#FF0000</color>

    <color name="green">#00FF00</color> <color name="blue">#0000FF</color> </resources> colors.xml R.color.red R.color.green R.color.blue public final class R { public static final class color { public static final int red=0x7f050002; public static final int green=0x7f050003; public static final int blue=0x7f050004; }} }}
  68. A 5 minutes introduction dimens.xml <?xml version="1.0" encoding="utf-8"?> <resources> <dimen

    name="btn_width">180dp</dimen> <dimen name="btn_height">100dp</dimen> </resources>
  69. A 5 minutes introduction dimens.xml public final class R {

    public static final class dimen { public static final int btn_width=0x7f030004; public static final int btn_height=0x7f050002; }} }} <?xml version="1.0" encoding="utf-8"?> <resources> <dimen name="btn_width">180dp</dimen> <dimen name="btn_height">100dp</dimen> </resources>
  70. A 5 minutes introduction dimens.xml R.dimen.btn_width R.dimen.btn_height public final class

    R { public static final class dimen { public static final int btn_width=0x7f030004; public static final int btn_height=0x7f050002; }} }} <?xml version="1.0" encoding="utf-8"?> <resources> <dimen name="btn_width">180dp</dimen> <dimen name="btn_height">100dp</dimen> </resources>
  71. A 5 minutes introduction strings.xml <?xml version="1.0" encoding="utf-8"?> <resources> <string

    name="btn_text">Click me</string> <string name="hello">Hello World!</string> </resources>
  72. A 5 minutes introduction strings.xml <?xml version="1.0" encoding="utf-8"?> <resources> <string

    name="btn_text">Click me</string> <string name="hello">Hello World!</string> </resources> public final class R { public static final class string { public static final int btn_text=0x7f05001e; public static final int hello=0x7f050030; }} }}
  73. A 5 minutes introduction strings.xml R.string.btn_text R.string.hello public final class

    R { public static final class string { public static final int btn_text=0x7f05001e; public static final int hello=0x7f050030; }} }} <?xml version="1.0" encoding="utf-8"?> <resources> <string name="btn_text">Click me</string> <string name="hello">Hello World!</string> </resources>
  74. A 5 minutes introduction my_screen.xml <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:app="http://schemas.android.com/apk/res-auto"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </android.support.constraint.ConstraintLayout>
  75. A 5 minutes introduction my_screen.xml public final class R {

    public static final class layout { public static final int my_screen=0x7f64003e; }} }} <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </android.support.constraint.ConstraintLayout>
  76. A 5 minutes introduction my_screen.xml R.layout.my_screen public final class R

    { public static final class layout { public static final int my_screen=0x7f64003e; }} }} <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </android.support.constraint.ConstraintLayout>
  77. A 5 minutes introduction my_screen.xml <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:app="http://schemas.android.com/apk/res-auto"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </android.support.constraint.ConstraintLayout>
  78. A 5 minutes introduction my_screen.xml public final class R {

    public static final class id { public static final int myButton=0x7f64003e; public static final int myTextView=0x7f64003e; }} }} <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </android.support.constraint.ConstraintLayout>
  79. A 5 minutes introduction my_screen.xml R.id.myButton R.id.myTextView public final class

    R { public static final class id { public static final int myButton=0x7f64003e; public static final int myTextView=0x7f64003e; }} }} <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </android.support.constraint.ConstraintLayout>
  80. A 5 minutes introduction import android.app.Activity class MyActivity : Activity()

    {{ override fun onCreate(savedInstanceState: Bundle?) { }} }}
  81. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() {{ override fun onCreate(savedInstanceState: Bundle?) { }} }}
  82. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() {{ override fun onCreate(savedInstanceState: Bundle?) { super.onCreate() }} }}
  83. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() {{ override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) }} }}
  84. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() {{ override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView() }} }}
  85. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) }} }}
  86. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) }} }}
  87. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) }} }} import android.app.Activity import android.os.Bundle public class MyActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.my_screen); }} }} MainActivity.kt MainActivity.java
  88. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) }} }} import android.app.Activity import android.os.Bundle public class MyActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.my_screen); }} }} MainActivity.kt MainActivity.java
  89. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) }} }} import android.app.Activity import android.os.Bundle public class MyActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.my_screen); }} }} MainActivity.kt MainActivity.java
  90. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) }} }} import android.app.Activity import android.os.Bundle public class MyActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.my_screen); }} }} MainActivity.kt MainActivity.java
  91. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate() { }} }} import android.app.Activity import android.os.Bundle public class MyActivity extends Activity { @Override protected void onCreate() { }} }} MainActivity.kt MainActivity.java
  92. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { }} }} import android.app.Activity import android.os.Bundle public class MyActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { }} }} MainActivity.kt MainActivity.java
  93. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) }} }} import android.app.Activity import android.os.Bundle public class MyActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.my_screen); }} }} MainActivity.kt MainActivity.java
  94. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) }} }} import android.app.Activity import android.os.Bundle public class MyActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.my_screen); }} }} MainActivity.kt MainActivity.java
  95. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) }} }} MainActivity.kt
  96. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) findViewById() }} }} MainActivity.kt
  97. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) findViewById<View>() }} }} MainActivity.kt
  98. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) findViewById<View>(R.id.myButton) }} }} MainActivity.kt
  99. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) findViewById<View>(R.id.myButton).setOnClickListener { }} }} }} MainActivity.kt
  100. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) findViewById<View>(R.id.myButton).setOnClickListener { if () { }} }} }} }} MainActivity.kt
  101. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) findViewById<View>(R.id.myButton).setOnClickListener { if () { // Hide }} }} }} }} MainActivity.kt
  102. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) findViewById<View>(R.id.myButton).setOnClickListener { if () { // Hide } else { // Show }} }} }} }} MainActivity.kt
  103. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) findViewById<View>(R.id.myButton).setOnClickListener { if (findViewById<View>()) { // Hide } else { // Show }} }} }} }} MainActivity.kt
  104. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) findViewById<View>(R.id.myButton).setOnClickListener { if (findViewById<View>(R.id.myTextView)) { // Hide } else { // Show }} }} }} }} MainActivity.kt
  105. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) findViewById<View>(R.id.myButton).setOnClickListener { if (findViewById<View>(R.id.myTextView).visibility == View.VISIBLE) { // Hide } else { // Show }} }} }} }} MainActivity.kt
  106. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) findViewById<View>(R.id.myButton).setOnClickListener { if (findViewById<View>(R.id.myTextView).visibility == View.VISIBLE) { findViewById<View>(R.id.myTextView).visibility = View.INVISIBLE } else { // Show }} }} }} }} MainActivity.kt
  107. A 5 minutes introduction import android.app.Activity import android.os.Bundle class MyActivity

    : Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.my_screen) findViewById<View>(R.id.myButton).setOnClickListener { if (findViewById<View>(R.id.myTextView).visibility == View.VISIBLE) { findViewById<View>(R.id.myTextView).visibility = View.INVISIBLE } else { findViewById<View>(R.id.myTextView).visibility = View.VISIBLE }} }} }} }} MainActivity.kt
  108. A 5 minutes introduction findViewById<View>(R.id.myButton).setOnClickListener { if (findViewById<View>(R.id.myTextView).visibility == View.VISIBLE)

    { findViewById<View>(R.id.myTextView).visibility = View.INVISIBLE } else { findViewById<View>(R.id.myTextView).visibility = View.VISIBLE }} }} MainActivity.kt findViewById(R.id.myButton).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (findViewById(R.id.myTextView).getVisibility() == View.VISIBLE) { findViewById(R.id.myTextView).setVisibility(View.INVISIBLE); } else { findViewById(R.id.myTextView).setVisibility(View.VISIBLE); }} }} }); MainActivity.java
  109. A 5 minutes introduction findViewById<View>(R.id.myButton).setOnClickListener { if (findViewById<View>(R.id.myTextView).visibility == View.VISIBLE)

    { findViewById<View>(R.id.myTextView).visibility = View.INVISIBLE } else { findViewById<View>(R.id.myTextView).visibility = View.VISIBLE }} }} MainActivity.kt findViewById(R.id.myButton).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (findViewById(R.id.myTextView).getVisibility() == View.VISIBLE) { findViewById(R.id.myTextView).setVisibility(View.INVISIBLE); } else { findViewById(R.id.myTextView).setVisibility(View.VISIBLE); }} }} }); MainActivity.java
  110. A 5 minutes introduction findViewById<View>(R.id.myButton).setOnClickListener { if (findViewById<View>(R.id.myTextView).visibility == View.VISIBLE)

    { findViewById<View>(R.id.myTextView).visibility = View.INVISIBLE } else { findViewById<View>(R.id.myTextView).visibility = View.VISIBLE }} }} MainActivity.kt findViewById(R.id.myButton).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (findViewById(R.id.myTextView).getVisibility() == View.VISIBLE) { findViewById(R.id.myTextView).setVisibility(View.INVISIBLE); } else { findViewById(R.id.myTextView).setVisibility(View.VISIBLE); }} }} }); MainActivity.java
  111. Kotlin Appeared in 2011 Created by JetBrains JetBrains develops IntelliJ,

    PyCharm, WebStorm Runs on the JVM •Clojure •Groovy •JRuby •Jython •Scala Officially supported by Google
  112. A 5 minutes introduction MyClass.java MyClass.kt class MyClass { fun

    sayHello() { return "" }} }} public class MyClass { }}
  113. A 5 minutes introduction MyClass.java MyClass.kt class MyClass { fun

    sayHello(name: String) { return "" }} }} public class MyClass { }}
  114. A 5 minutes introduction MyClass.java MyClass.kt class MyClass { fun

    sayHello(name: String): String { return "" }} }} public class MyClass { }}
  115. A 5 minutes introduction MyClass.java MyClass.kt class MyClass { fun

    sayHello(name: String): String { return "Hello !" }} }} public class MyClass { }}
  116. A 5 minutes introduction MyClass.java MyClass.kt class MyClass { fun

    sayHello(name: String): String { return "Hello $name!" }} }} public class MyClass { }}
  117. A 5 minutes introduction MyClass.java MyClass.kt class MyClass { fun

    sayHello(name: String): String { return "Hello $name!" }} }} public class MyClass { public String sayHello(String name) { return "Hello " + name + "!"; }} }}
  118. A 5 minutes introduction MyClass.java MyClass.kt fun circleArea(radius: Double): Double

    { val PI = 3.1416 return PI * Math.pow(radius, 2.0) / 2 }} public double circleArea(double radius) { double PI = 3.1416; return (PI * Math.pow(radius, 2.0)) / 2; }}
  119. A 5 minutes introduction MyClass.java MyClass.kt fun circleArea(radius: Double): Double

    { var PI = 3.1416 return PI * Math.pow(radius, 2.0) / 2 }} public double circleArea(double radius) { double PI = 3.1416; return (PI * Math.pow(radius, 2.0)) / 2; }}
  120. Kotlin vs Java Null safe Interoperable with Java Extension functions

    Smart casts String templates Properties (getter/setters in Java) Type inference Data classes Range expressions
  121. Kotlin vs Java Null safe Interoperable with Java Extension functions

    Smart casts String templates Properties (getter/setters in Java) Type inference Data classes Range expressions
  122. Kotlin vs Java fun concatName(name: String, last: String): String {

    return "$name $last" }} MyClass.java MyClass.kt public String concatName(String name, String last) { if (name != null && last != null) { return name.concat(" ").concat(last); } else { return null; }} }}
  123. Kotlin vs Java fun concatName(name: String?, last: String?): String? {

    return "$name $last" }} MyClass.java MyClass.kt public String concatName(String name, String last) { if (name != null && last != null) { return name.concat(" ").concat(last); } else { return null; }} }}
  124. Kotlin vs Java fun concatName(name: String!, last: String!): String? {

    return "$name $last" }} MyClass.java MyClass.kt public String concatName(String name, String last) { if (name != null && last != null) { return name.concat(" ").concat(last); } else { return null; }} }}
  125. Kotlin vs Java Null safe Interoperable with Java Extension functions

    Smart casts String templates Properties (getter/setters in Java) Type inference Data classes Range expressions
  126. Kotlin vs Java MyClass.java MyClass.kt public String concatName(String name, String

    last) { if (name != null && last != null) { return name.concat(" ").concat(last); } else { return null; }} }} class MyClass { fun sayHello(name: String, last: String): String { MyClass obj = MyClass() return "Hello ${obj.concat(name)}!” }} }}
  127. Kotlin vs Java Null safe Interoperable with Java Extension functions

    Smart casts String templates Properties (getter/setters in Java) Type inference Data classes Range expressions
  128. Kotlin vs Java Extensions.kt fun String.appendA(): String { return this.plus("A")

    } AnyClass.kt fun useExtensionFunction(anyString: String): String { return anyString.appendA() }
  129. Kotlin vs Java Null safe Interoperable with Java Extension functions

    Smart casts String templates Properties (getter/setters in Java) Type inference Data classes Range expressions
  130. A 5 minutes introduction MyClass.java MyClass.kt fun handleString(text: Any): String?

    { if (text is String) { return "$text other value" } else { return null } } public String handleString(Object text) { if (text instanceof String) { return ((String) text).concat(" other value"); } else { return null; } }
  131. Kotlin vs Java Null safe Interoperable with Java Extension functions

    Smart casts String templates Properties (getter/setters in Java) Type inference Data classes Range expressions
  132. Kotlin vs Java fun concatName(name: String, last: String): String {

    return "$name $last" }} MyClass.java MyClass.kt public String concatName(String name, String last) { if (name != null && last != null) { return name.concat(" ").concat(last); } else { return null; }} }}
  133. Kotlin vs Java fun concatName(name: String, last: String): String {

    return "$name $last" }} MyClass.java MyClass.kt public String concatName(String name, String last) { if (name != null && last != null) { return name.concat(" ").concat(last); } else { return null; }} }}
  134. Kotlin vs Java Null safe Interoperable with Java Extension functions

    Smart casts String templates Properties (getter/setters in Java) Type inference Data classes Range expressions
  135. Kotlin vs Java Address.kt val address : Address = Address()

    address.state = "bar" address.street = "bar" address.city = "bar" address.zip = "bar" class Address { var name: String = "foo" var street: String = "foo" var city: String = "foo" var state: String = "foo" var zip: String = "foo" }
  136. Kotlin vs Java Address.kt val what = address.state class Address

    { val name: String = "foo" val street: String = "foo" val city: String = "foo" val state: String = "foo" val zip: String = "foo" } // read only
  137. Kotlin vs Java public class Address { String state; String

    street; String city; String zip; public String getState() { return state; } public void setState(String state) { this.state = state; } public String getStreet() { return street; } public void setStreet(String street) { this.street = street; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getZip() { return zip; } public void setZip(String zip) { this.zip = zip; } }
  138. Kotlin vs Java Null safe Interoperable with Java Extension functions

    Smart casts String templates Properties (getter/setters in Java) Type inference Data classes Range expressions
  139. Kotlin vs Java val age = 13 val name =

    "Elon" val girls: Int = 7 val place: String = "Home"
 
 
 
 MyClass.kt
  140. Kotlin vs Java val age = 13 val name =

    "Elon" val girls: Int = 7 val place: String = "Home"
 
 
 
 int age = 13; String name = "Elon"; MyClass.kt MyClass.java
  141. Kotlin vs Java Null safe Interoperable with Java Extension functions

    Smart casts String templates Properties (getter/setters in Java) Type inference Data classes Range expressions