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
420
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
印西市創業実践プログラム2026 【AI活用講座】
jollyjoester
0
6
AI時代でも変わらない技術コミュニティの力 ~10年続く"ゆるい"つながりが生み出す価値~
jollyjoester
0
9
AIコードアシスタントとiOS開発
jollyjoester
1
350
市民のためのセキュリティ講座
jollyjoester
0
72
コミュニティMTG in WWDC24
jollyjoester
0
330
BengaluruでLTしてきた
jollyjoester
0
380
try! Swift Tokyo 2024
jollyjoester
0
370
エンジニアが直接会う場の価値について
jollyjoester
8
4.6k
来年Proposalを出すつもりで参加するときっともっと楽しい!
jollyjoester
0
400
Other Decks in Technology
See All in Technology
Keycloak を使った SSO で CockroachDB にログインする / CockroachDB SSO with Keycloak
kota2and3kan
0
110
僕、S3 シンプルって名前だけど全然シンプルじゃありません よろしくお願いします
yama3133
1
210
「Blue Team Labs Online」入門 - みんなで挑むログ解析バトル
v_avenger
0
160
スクリプトの先へ!AIエージェントと組み合わせる モバイルE2Eテスト
error96num
0
170
Dr. Werner Vogelsの14年のキーノートから紐解くエンジニアリング組織への処方箋@JAWS DAYS 2026
p0n
1
130
JAWS FESTA 2025でリリースしたほぼリアルタイム文字起こし/翻訳機能の構成について
naoki8408
1
430
非情報系研究者へ送る Transformer入門
rishiyama
11
7.4k
作りっぱなしで終わらせない! 価値を出し続ける AI エージェントのための「信頼性」設計 / Designing Reliability for AI Agents that Deliver Continuous Value
aoto
PRO
2
290
脳内メモリ、思ったより揮発性だった
koutorino
0
320
猫でもわかるKiro CLI(AI 駆動開発への道編)
kentapapa
0
170
AIエージェント時代に備える AWS Organizations とアカウント設計
kossykinto
3
880
Shifting from MCP to Skills / ベストプラクティスの変遷を辿る
yamanoku
4
830
Featured
See All Featured
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
170
Paper Plane
katiecoart
PRO
0
48k
Testing 201, or: Great Expectations
jmmastey
46
8.1k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.1k
My Coaching Mixtape
mlcsv
0
71
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
64
53k
Making the Leap to Tech Lead
cromwellryan
135
9.8k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
230
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
160
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
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