Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Using Google Maps Platform with idiomatic Kotli...
Search
jollyjoester
July 21, 2021
Technology
0
380
Using Google Maps Platform with idiomatic Kotlinまとめ
集まれKotlin好き!Kotlin愛好会 vol.30 @オンライン
https://love-kotlin.connpass.com/event/218515/
jollyjoester
July 21, 2021
Tweet
Share
More Decks by jollyjoester
See All by jollyjoester
コミュニティMTG in WWDC24
jollyjoester
0
250
BengaluruでLTしてきた
jollyjoester
0
290
try! Swift Tokyo 2024
jollyjoester
0
270
エンジニアが直接会う場の価値について
jollyjoester
8
4.1k
来年Proposalを出すつもりで参加するときっともっと楽しい!
jollyjoester
0
310
My favorite sessions in WWDC 23
jollyjoester
0
600
みんなでAIと戯れよう
jollyjoester
0
120
続く勉強会の作り方
jollyjoester
2
820
Code for INZAIの歩み
jollyjoester
0
410
Other Decks in Technology
See All in Technology
現場の種を事業の芽にする - エンジニア主導のイノベーションを事業戦略に装着する方法 -
kzkmaeda
2
2k
個人開発から公式機能へ: PlaywrightとRailsをつなげた3年の軌跡
yusukeiwaki
11
3k
Developers Summit 2025 浅野卓也(13-B-7 LegalOn Technologies)
legalontechnologies
PRO
0
690
エンジニアのためのドキュメント力基礎講座〜構造化思考から始めよう〜(2025/02/15jbug広島#15発表資料)
yasuoyasuo
16
6.6k
技術的負債解消の取り組みと専門チームのお話 #技術的負債_Findy
bengo4com
1
1.3k
技術負債の「予兆検知」と「状況異変」のススメ / Technology Dept
i35_267
1
1.1k
Developer Summit 2025 [14-D-1] Yuki Hattori
yuhattor
19
6.2k
Amazon S3 Tablesと外部分析基盤連携について / Amazon S3 Tables and External Data Analytics Platform
nttcom
0
130
AndroidXR 開発ツールごとの できることできないこと
donabe3
0
130
エンジニアの育成を支える爆速フィードバック文化
sansantech
PRO
3
1.1k
Nekko Cloud、 これまでとこれから ~学生サークルが作る、 小さなクラウド
logica0419
2
960
2025-02-21 ゆるSRE勉強会 Enhancing SRE Using AI
yoshiiryo1
1
270
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.2k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
12
960
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Code Reviewing Like a Champion
maltzj
521
39k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
193
16k
Into the Great Unknown - MozCon
thekraken
35
1.6k
Rails Girls Zürich Keynote
gr2m
94
13k
Agile that works and the tools we love
rasmusluckow
328
21k
Typedesign – Prime Four
hannesfritz
40
2.5k
Unsuck your backbone
ammeep
669
57k
Transcript
Using Google Maps Platform with idiomatic Kotlinまとめ 2021/07/21 Kotlin愛好会 vol.30
jollyjoester
この談義について • この談義はGoogle I/O 2021のUsing Google Maps Platform with idiomatic
Kotlinのセッション動画を見てまとめたものです。 • わかりやすい構成・英語なのでぜひ見てみてください!(初中級向け?)
Javaで開発されているGoogle Maps PlatformのSDKを KTXを使って Kotlinらしい書き方で使えるよ! サマリ
背景:3つのSDK Maps SDK for Android (2012) Maps SDK Utility Library
Places SDK (2015, 2019) →Javaで作られている c.f. 1:00 https://events.google.com/io/session/a898055b-44d0-460a-bf4f-b4512c964441?lng=en
背景:SDKをKotlinらしく使うには? SDK written in Java Java Kotlin Kotlin KTX SDK
written in Java SDK written in Java
KotlinのExtention(拡張機能)の集まり JetpackとかのAPIを最適化するためによく使われる Kotlinの言語機能を使ってAndroidアプリの開発をより簡潔で快適にするよ! Maps, PlacesのKTXオープンソースになってるよ! • android-maps-ktx • android-places-ktx KTX
使い方 c.f. 4:39 https://events.google.com/io/session/a898055b-44d0-460a-bf4f-b4512c964441?lng=en
Mountain View → Mexico City へ アニメーションしながら移動する Example 1
Without Maps KTX c.f. 5:25 https://events.google.com/io/session/a898055b-44d0-460a-bf4f-b4512c964441?lng=en
Without KTX ①Mountain Viewまでカメラをアニメーション する
Without Maps KTX ②2秒待つ
Without Maps KTX ③Mexico Cityまでカメラをアニメーションする
コールバック地獄😢 見る場所が飛んでて読みにくい😢 Without KTX
With Maps KTX c.f. 6:29 https://events.google.com/io/session/a898055b-44d0-460a-bf4f-b4512c964441?lng=en ③Mexico Cityまでカメラを アニメーションする ②2秒待つ
①Mountain Viewまでカメラをア ニメーションする
With Maps KTX c.f. 6:29 https://events.google.com/io/session/a898055b-44d0-460a-bf4f-b4512c964441?lng=en サスペンド関数
With Maps KTX c.f. 6:29 https://events.google.com/io/session/a898055b-44d0-460a-bf4f-b4512c964441?lng=en サスペンド関数
With Maps KTX c.f. 6:29 https://events.google.com/io/session/a898055b-44d0-460a-bf4f-b4512c964441?lng=en サスペンド関数をどんなスコープ で実行したりするか
通常の同期的なコードと同じ逐次的な書き方👍 フラットで読みやすい👍 Kotlin coroutines & suspending functions🙌 With Maps KTX
Autocomplete Place Predictions 一部のテキスト入力すると場所を推測して取ってくるやつ Example 2
Without Place KTX c.f. 8:39 https://events.google.com/io/session/a898055b-44d0-460a-bf4f-b4512c964441?lng=en requestをビルド
Without Place KTX c.f. 8:39 https://events.google.com/io/session/a898055b-44d0-460a-bf4f-b4512c964441?lng=en SuccessとFailureのlambdaを書 く必要あり
With Place KTX c.f. 9:08 https://events.google.com/io/session/a898055b-44d0-460a-bf4f-b4512c964441?lng=en Kotlin DSL スタイル
With Place KTX c.f. 9:08 https://events.google.com/io/session/a898055b-44d0-460a-bf4f-b4512c964441?lng=en サスペンド関数
With Place KTX Kotlin DSL〜(素敵そうだけどそこまで便利さわかってない。わかる方いたら教えて🙏) ハンドラー全部実装する必要ない(すっきり〜) Kotlin coroutines & suspending
functions🙌
• Codelabs ◦ 地図をAndroidアプリに追加する • Kotlin documentation snippets ◦ Google
Maps Platform Documentation • Sample code ◦ https://github.com/googlemaps/android-samples ◦ https://github.com/googlemaps/android-places-demos Learning Maps & Kotlin
感想 Kotlin Corotinesかわいい 既存の資産を最新の形で使いやすくするKTXすごい 拡張なのででかいリファクタをしなくても部分的に新しい書き方を導入できるの便利
Refs. セッション動画 • Using Google Maps Platform with idiomatic Kotlin