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

Kotlin Android APP DOJO

Kotlin Android APP DOJO

KotlinによるAndroidアプリ開発の最新情報
https://events.withgoogle.com/app-dojo-april-2018-2nd/

# Links

今から始めるKotlinによるAndroidアプリ開発
https://speakerdeck.com/satorufujiwara/how-to-start-kotlin-app-dojo

Android Kotlin Guides
https://android.github.io/kotlin-guides/

Kotlin 1.2
https://blog.jetbrains.com/jp/2017/11/29/828

Kotlin and Android
https://developer.android.com/kotlin/index.html

DroidKaigi 2018 オフィシャルアプリ
https://github.com/DroidKaigi/conference-app-2018

JavaプログラマのためのKotlin入門
https://qiita.com/koher/items/bcc58c01c6ff2ece658f

【Android】Kotlin導入するためにやったこと(説得編)
https://qiita.com/rkowase/items/a2f26c64c60d04d51c94

【Android】Kotlin導入するためにやったこと(学習編)
https://qiita.com/rkowase/items/14451421ee96f0f8a7f5

Kotlinの型を知る ~前編~
https://qiita.com/AAkira/items/16ae2e9c0f6073e0e983

Kotlinの型を知る ~後編~ プラットフォーム型とCollections
https://qiita.com/satorufujiwara/items/1399433529f1defa5b12

Kotlin スコープ関数 用途まとめ
https://qiita.com/ngsw_taro/items/d29e3080d9fc8a38691e

satorufujiwara

April 24, 2018
Tweet

More Decks by satorufujiwara

Other Decks in Programming

Transcript

  1. KotlinʹΑΔ
    AndroidΞϓϦ։ൃ
    ࠷৽৘ใ
    2018.04.24 APP DOJO
    @satorufujiwara

    View full-size slide

  2. About me
    Satoru Fujiwara (@satorufujiwara)
    Android Engineer @CyberAgent ,Inc
    Organizer of Shibuya.apk
    ༁ॻ : Kotlin ΠϯɾΞΫγϣϯ
    ஶॻ : Android ΞϓϦઃܭύλʔϯೖ໳

    View full-size slide

  3. ࠓ೔࿩͢͜ͱ
    • Kotlinͱ͸ (2017೥8݄29೔ͷAPP DOJOͷ෮श)
    • KotlinͰͷAndroidΞϓϦ։ൃ࠷৽৘ใ
    • ࠓ͔ΒKotlinΛֶͿͷʹ͓͢͢ΊͷϦιʔε

    View full-size slide

  4. ࠓ೔࿩͢͜ͱ
    • Kotlinͱ͸ (2017೥8݄29೔ͷAPP DOJOͷ෮श)
    • KotlinͰͷAndroidΞϓϦ։ൃ࠷৽৘ใ
    • ࠓ͔ΒKotlinΛֶͿͷʹ͓͢͢ΊͷϦιʔε

    View full-size slide

  5. Kotlinͷߟ͑ํ
    • ࣮༻ओٛ - Javaͷߟ͑ํ͕ͦͷ··࢖͑Δɻ৽͍͠ػೳ͸طଘͷ΋ͷ
    Λར༻ɻֶश͕༰қɻ
    • ؆ܿ - ಡΈ΍͢͞ΛॏࢹɻϘΠϥʔϓϨʔτ͸ۃྗݮΒ͢ɻ
    • ҆શ - ੩తܕ෇͚ɻNull҆શɻεϚʔτΩϟετɻ
    • ૬ޓӡ༻ੑ - JavaͱKotlinͷؒ͸ࣗ༝ʹߦ͖དྷɻϥΠϒϥϦ΋طଘͷ
    ΋ͷΛͦͷ··ར༻Ͱ͖Δɻ

    View full-size slide

  6. Kotlinͷ஫ҙ఺
    • Javaͷ୅ସݴޠͰ͋Γ࣮༻ओٛͰ͋ΔͷͰɺࣗ༝౓͕ߴ͍
    • ؆ܿʹॻ͖͗͢ΔͱಡΈʹ͘͘ͳΔ͜ͱ΋
    • ༷ʑͳศརͳݴޠػೳ͕͞Βʹࣗ༝౓ΛߴΊΔ
    • ·ͣ͸ Nullڐ༰ܕ/Nullඇڐ༰ܕΛ۠ผ͢Δ ͜ͱʹؾΛ͚ͭΔ

    View full-size slide

  7. speakerdeck.com/satorufujiwara/how-to-start-kotlin-app-dojo

    View full-size slide

  8. ࠓ೔࿩͢͜ͱ
    • Kotlinͱ͸ (2017೥8݄29೔ͷAPP DOJOͷ෮श)
    • KotlinͰͷAndroidΞϓϦ։ൃ࠷৽৘ใ
    • ࠓ͔ΒKotlinΛֶͿͷʹ͓͢͢ΊͷϦιʔε

    View full-size slide

  9. KotlinͰͷAndroidΞϓϦ։ൃ࠷৽৘ใ
    • Android Studio 3.0 ਖ਼ࣜϦϦʔε (2017/10/25)
    • KotlinConf & Kotlin Android Guide (2017/11/2)
    • Kotlin 1.2 ϦϦʔε (2017/11/28)
    • Android KTX (2018/2/5)
    • Support Library΁ͷ Nullable / NonNull Ξϊςʔγϣϯͷ௥Ճ

    View full-size slide

  10. Android Studio 3.0 ϦϦʔε
    • KotlinͷϓϥάΠϯ͕σϑΥϧτͰೖͬͨ
    • ϓϩδΣΫτ։࢝࣌ʹKotlinͰ։ൃΛ࢝ΊΔ͜ͱ͕Մೳ

    View full-size slide

  11. Convert Java to Kotlin
    • JavaͷϑΝΠϧΛબ୒ͯ͠ʮCodeʯϝχϡʔ͔Β
    ʮConvert Java File to Kotlin FileʯΛબͿ͜ͱͰίʔυ͕
    Kotlinʹม׵͞ΕΔ
    • JavaͷίʔυΛKotlinͷϑΝΠϧ(.kt)΁ίϐϖ͢Δ͜ͱͰ
    ΋Kotlinʹม׵͞ΕΔ
    • Kotlinͷֶशʹศར͕ͩɺྑ͍ίʔυͱ͸ݶΒͳ͍ͷͰ
    ஫ҙ͕ඞཁ

    View full-size slide

  12. Kotlin Conf
    • KotlinΛςʔϚʹͨ͠ॳͷΧϯϑΝϨϯε
    • 2017೥11݄2೔ɺ3೔ʹαϯϑϥϯγείͰ։࠵͞Εͨ
    • ओ࠵͸JetBrains
    • ࠓ೥͸10݄3೔-5೔ ΦϥϯμͷΞϜεςϧμϜͰ։࠵

    View full-size slide

  13. Kotlin Conf Keynote
    • Kotlin 1.2 RC
    • Kotlin/Native iOS αϙʔτ
    • Android StudioͰͷKotlinར༻཰͕17ˋʹ
    • Support LibraryʹKotlinΞϊςʔγϣϯ
    • Android Kotlin Guides

    View full-size slide

  14. Android Kotlin Guides
    https://android.github.io/kotlin-guides/

    View full-size slide

  15. Android Kotlin Guides
    • AndroidΛKotlinͰॻ͘ࡍͷࢦ਑
    • ਵ࣌Ξοϓσʔτ͞Ε͍ͯΔ
    • Style Guide (Kotlinίʔυͷॻ͖ํ)
    • Interop Guide (KotlinͱJavaͷ૬ޓӡ༻ͷͨΊͷϧʔϧ)

    View full-size slide

  16. Style Guide ͷҰྫ

    View full-size slide

  17. Kotlin 1.2
    • ϚϧνϓϥοτϑΥʔϜϓϩδΣΫτ
    • ίϯύΠϧύϑΥʔϚϯεͷ޲্ (໿25ˋ)
    • ΑΓৄ͘͠͸JetBrainsͷϒϩάʹͯ
    • https://blog.jetbrains.com/jp/2017/11/29/828 (೔ຊޠ)

    View full-size slide

  18. Android KTX
    • AndroidͰ࢖͑ΔKotlinͷ֦ுؔ਺܈
    • ϓϨϏϡʔ൛ ͱͯ͠ϦϦʔε (࠷৽͸ 0.3)
    • Support Library ରԠ൛͸ࠓޙͷϦϦʔε

    View full-size slide

  19. Android KTXͷྫ ͦͷ1
    Javaͷstaticͳؔ਺ݺͼग़͕͠ม਺ͷޙΖʹҠಈ
    ྲྀΕΔΑ͏ʹίʔυ͕ॻ͚Δ

    View full-size slide

  20. Android KTXͷྫ ͦͷ2
    ViewͷVISIBLE/GONE౳͕BooleanܕͰදݱͰ͖ɺ
    ௚ײతʹཧղ͠΍͍͢

    View full-size slide

  21. Support Library΁ͷ
    Nullable / NonNull Ξϊςʔγϣϯͷ௥Ճ
    • android.support.annotation.NonNull ͓Αͼ Nullable Λ Kotlin ͷ
    ίϯύΠϥ͸Nullඇڐ༰ܕɺNullڐ༰ܕͱͯ͠ೝࣝ͢Δ

    View full-size slide

  22. ࠓ೔࿩͢͜ͱ
    • Kotlinͱ͸ (2017೥8݄29೔ͷAPP DOJOͷ෮श)
    • KotlinͰͷAndroidΞϓϦ։ൃ࠷৽৘ใ
    • ࠓ͔ΒKotlinΛֶͿͷʹ͓͢͢ΊͷϦιʔε

    View full-size slide

  23. Kotlin and Android
    https://developer.android.com/kotlin/index.html

    View full-size slide

  24. Kotlion and Android
    • ਵ࣌ߋ৽͞Ε͍ͯΔ
    • KotlinʹΑΔAndroidϓϩδΣΫτͷ࢝Ίํ
    • Kotlin Samples ʹଟ͘ͷKotlinͰॻ͔Εͨαϯϓϧ͕͋Δ

    View full-size slide

  25. DroidKaigi 2018 ΦϑΟγϟϧΞϓϦ
    https://github.com/DroidKaigi/conference-app-2018

    View full-size slide

  26. DroidKaigi 2018 ΦϑΟγϟϧΞϓϦ
    • ϑϧKotlin
    • ϝΠϯ։ൃऀ͸ takahirom ͞Μ (ࠓ೔ͷϝϯλʔʂ)
    • Android։ൃʹ͓͚Δϊ΢ϋ΢͕͗Ύͬͱ٧·͍ͬͯΔ
    • ·ͣ͸ɺ֦ுؔ਺ͷ࢖ΘΕํɺఆٛͷ࢓ํΛݟͯ΋ྑͦ͞͏

    View full-size slide

  27. ֦ுؔ਺ͷྫ

    View full-size slide

  28. Kotlin ΠϯɾΞΫγϣϯ
    2017೥10݄31೔ൃച

    View full-size slide

  29. Kotlin ΠϯɾΞΫγϣϯ
    • Kotlinͷ։ൃνʔϜʹΑͬͯॻ͔Εͨຊ
    • Kotlinͷݴޠ࢓༷͕ͳͥͦ͏ͳͬͨͷ͔ʁͱ͍͏ίϯηϓτ͔
    Βɺجຊతͳݴޠػೳɺͦͯ͠ൃలػೳ·ͰΧόʔ
    • ೔ຊޠ൛΁ͷ຋༁͸ࢲ΋ؚΊͨݱ໾ͷAndroidΤϯδχΞ͕୲౰

    View full-size slide

  30. Kotlin ΠϯɾΞΫγϣϯͷಡΈํ
    • Javaͷ஌ࣝΛલఏʹ͍ͯ͠Δ
    • ͱΓ͋͑ͣ Kotlin ͰAndroidΛॻ͖࢝ΊɺҰ௨Γจ๏Λཧղͨ͠
    ޙɺୈҰ෦ʮKotlinΛ஌ΔʯΛಡΉ
    • ୈೋ෦͸গ͠Kotlinʹ׳Ε͔ͯΒ

    View full-size slide

  31. Qiita
    • JavaϓϩάϥϚͷͨΊͷKotlinೖ໳
    • https://qiita.com/koher/items/bcc58c01c6ff2ece658f
    • ʲAndroidʳKotlinಋೖ͢ΔͨΊʹ΍ͬͨ͜ͱʢઆಘฤʣ
    • https://qiita.com/rkowase/items/a2f26c64c60d04d51c94
    • ʲAndroidʳKotlinಋೖ͢ΔͨΊʹ΍ͬͨ͜ͱʢֶशฤʣ
    • https://qiita.com/rkowase/items/14451421ee96f0f8a7f5
    • KotlinͷܕΛ஌Δ ~લฤ~
    • https://qiita.com/AAkira/items/16ae2e9c0f6073e0e983
    • KotlinͷܕΛ஌Δ ~ޙฤ~ ϓϥοτϑΥʔϜܕͱCollections
    • https://qiita.com/satorufujiwara/items/1399433529f1defa5b12
    • Kotlin είʔϓؔ਺ ༻్·ͱΊ
    • https://qiita.com/ngsw_taro/items/d29e3080d9fc8a38691e

    View full-size slide

  32. ·ͱΊ
    • Kotlinͷ࠷৽͸1.2 ͰϚϧνϓϥοτϑΥʔϜରԠ
    • Kotlin Android Guide / Android KTX / Support Library
    • ࠷৽৘ใ͸ KotlinConf (΍Google I/O) ΛνΣοΫ
    • ެࣜυΩϡϝϯτ͕๛෋ / DroidKaigiΞϓϦͳͲΛࢀߟʹ
    • ΑΓਂ͘஌Δʹ͸ Kotlin ΠϯɾΞΫγϣϯ ͳͲͰ

    View full-size slide

  33. Thank you!
    Have a Nice Kotlin!

    View full-size slide