Kotlin 㨠Jetpack ã® MAD Skillsã¾ã¨ã
ãã®è¨äºã¯ Florina Muntenescu ã«ãã Android Developers Blog ã®è¨äº "MAD Skills Kotlin and Jetpack: wrap-up" ãå
ã«ç¿»è¨³・å çãããã®ã§ã。詳ããã¯å
è¨äºãã覧ãã ãã。 ä»å㯠MAD Skills ã·ãªã¼ãºã® 1 ã¤、Kotlin 㨠Jetpack ã«ã¤ãã¦ã®åç»ã¨è¨äºãã¾ã¨ãã¾ãã。Android ã³ã¼ãã®è¡¨ç¾åã¨ç°¡æ½ã、å®å
¨æ§ãåä¸ãã、Kotlin ã§éåæã³ã¼ããå®è¡ãããããããã¾ãã¾ãªæ¹æ³ãåãä¸ãã¦ãã¾ã。 ããããã®ã¨ãã½ã¼ããã、Kotlin 㨠Jetpack ã«ã¤ãã¦ã®ææ°æ
å ±ãã確èªãã ãã。ããã¤ãã®å
·ä½ç㪠API ãåãä¸ã、API ã®ä½¿ãæ¹ã ãã§ãªã、API ãå
é¨çã«ã©ã®ããã«åä½ãã¦ããã解説ãã¦ãã¾ã。ã¾ã、ãã¹ã¦ã®ã¨ãã½ã¼ãã«ã¯å¯¾å¿ããããã°æ稿ããã、ãã®ã»ã¨ãã©ã«ãµã³ãã«ã Codelab ã¸ã®ãªã³ã¯ãå«ã¾ãã¦ããã®ã§、å®éã«è©¦ãã¦ã¿ãã、ã³ã³ãã³ãã«é¢ããç解ãæ·±ãããã§ãã¾ã。ã¾ã、Jetpack ã Kotlin ã®ã¨ã³ã¸ãã¢ãç»å ´ãããªã¢ã«ã¿ã¤ã Q&A ãå®æ½ãã¾ãã。 ãã®ã¨ãã½ã¼ãã§ã¯、Jetpack KTX æ¡å¼µæ©è½ã使ã£ã¦、Android 㨠Jetpack ã®ã³ã¼ãã£ã³ã°ãç°¡å、å¿«é©、ãã㦠Kotlin ãããããæ¹æ³ãåãä¸ãã¾ãã。ç¾å¨ã®ã¨ãã、20 以ä¸ã®ã©ã¤ãã©ãªã« KTX çããã、ãã®ä¸ããç¹ã«éè¦ãªãã®ãç´¹ä»ãã¾ã。core-ktx ã¯、Android ãã©ãããã©ã¼ã ã«ç±æ¥ãã API ã Kotlin ãããæ¸ããããã«ããæ©è½ãæä¾ãã¦ãã¾ã。ã¾ã、LiveData ã ViewModel ãªã©ã® API ã¨çµã¿åããã¦ã¦ã¼ã¶ã¼ ã¨ã¯ã¹ããªã¨ã³ã¹ã®åä¸ãå³ããããã¤ãã® Jetpack KTX ã©ã¤ãã©ãªãç´¹ä»ãã¾ã。 åç»ã¾ãã¯ããã°è¨äº(è±èª)ãã覧ãã ãã。 ã¨ãã½ã¼ã 2 ã§ã¯、ã³ã«ã¼ãã³ã¨ Flow ã使ã£ã¦ API ãã·ã³ãã«ã«ããæ¹æ³ã¨、suspendCancellableCoroutine API 㨠callbackFlow API ã使ã£ã¦ç¬èªã®ã¢ããã¿ãä½ãæ¹æ³ã«ã¤ãã¦èª¬æãã¾ã。ãã®ãããã¯ãå®éã«è©¦ãã¦ã¿ããæ¹ã¯、Kotlin æ¡å¼µæ©è½ã©ã¤ãã©ãªã®ä½æ Codelab ãã覧ãã ãã。 åç»ãè¦è´ããã、ããã°è¨äº(è±èª)ã§ã確èªãã ãã。 ãã®ã¨ãã½ã¼ãã§ã¯、å®éã« Room ã使ã£ã¦ã¿ã¾ã。ãã®ä¸ã§、Kotlin ã使ã£ã¦ Room ã®ãã¼ãã«ããã¼ã¿ãã¼ã¹ãä½ãæ¹æ³、æ¿å
¥ãªã©ã® 1 åéãã® suspend æä½ãå®è£
ããæ¹æ³、Flow ã使ã£ãç£è¦å¯è½ã¯ã¨ãªã¼ã«ã¤ãã¦ç°¡åã«ç¢ºèªãã¾ã。ã³ã«ã¼ãã³ã¨ Flow ã使ãã¨、Room ã¯ãã¹ã¦ã®ãã¼ã¿ãã¼ã¹æä½ãããã¯ã°ã©ã¦ã³ã ã¹ã¬ããã«ç§»ãã¦ããã¾ã。Room ã®ã¯ã¨ãªã¼ã®å®è£
æ¹æ³ããã¹ãæ¹æ³ã«ã¤ãã¦ã¯、åç»ã¾ãã¯ããã°è¨äº(è±èª)ãã覧ãã ãã。å®éã«è©¦ãã¦ã¿ããæ¹ã¯、ãã¥ã¼ã§ Room ã使ã Codelab ãã覧ãã ãã。 ã¨ãã½ã¼ã 4 ã§ã¯、WorkManager ã使ã£ã¦ä½æ¥ãç°¡åã«ããæ¹æ³ã«ã¤ãã¦èª¬æãã¾ã。ãã®æ©è½ã使ãã¨、éåæã¿ã¹ã¯ã®ã¹ã±ã¸ã¥ã¼ã«ãè¨å®ãã¦、ã¢ããªãéããããå ´åã、ããã¤ã¹ãåèµ·åããå ´åã«ãå®è¡ããããã¨ãæå¾
ãããã¿ã¹ã¯ã、å³æå®è¡ã¾ãã¯é
延å®è¡ã§ãã¾ã。ãã®ã¨ãã½ã¼ãã§ã¯、WorkManager ã®åºæ¬ã«ã¤ãã¦èª¬æã、CoroutineWorker ãªã©ã® Kotlin API ã«ã¤ãã¦ã解説ãã¦ãã¾ã。 ãã¡ãã®åç»ã¾ãã¯ãã¡ãã®ããã°è¨äº(è±èª)ãã覧ãã ãã。ã¾ã、ãã² WorkManager Codelab ã§å®éã«ä½é¨ãã¦ã¿ã¦ãã ãã。 ã¨ãã½ã¼ã 5 ã§ã¯、Android ã® Google Developer Expert ã® Magda Miu ããã Kotlin ã®åºæ¬ API 㨠CameraX ã使ã£ãçµé¨ã«ã¤ãã¦ã話ããã¦ãã¾ã。 æå¾ã®ã¨ãã½ã¼ãã§ã¯、ãªã¢ã«ã¿ã¤ã Q&A ãå®æ½ãã¾ãã。å¸ä¼ã® Chet Haase ã®ã»ã、ã²ã¹ãã¨ã㦠Architecture Components ããã¯ãªã¼ãã® Yigit Boyar、Kotlin ãããã¯ã ããã¼ã¸ã£ã¼ã® David Winer、ããã¦ãããããã¼ ãªã¬ã¼ã·ã§ã³ãº ã¨ã³ã¸ãã¢ã® Manuel Vivo ã¨ç§ãåå ã、YouTube、Twitter ãªã©ããå¯ãããã質åã«åçãã¦ãã¾ã。 Reviewed by Yuichi Araki - Developer Relations Team and Hidenori Fujii - Google Play Developer Marketing APAC
ã¨ãã½ã¼ã 1 - KTX ã©ã¤ãã©ãªã®ä½¿ç¨
ã¨ãã½ã¼ã 2 - ã³ã«ã¼ãã³ã¨ Flow 㧠API ãã·ã³ãã«ã«
ã¨ãã½ã¼ã 3 - Room Kotlin API ã®ä½¿ç¨ã¨ãã¹ã
ã¨ãã½ã¼ã 4 - WorkManager Kotlin API ã®ä½¿ç¨
ã¨ãã½ã¼ã 5 - ã³ãã¥ãã㣠ãã³ã
ã¨ãã½ã¼ã 6 - ãªã¢ã«ã¿ã¤ã Q&A