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
390
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
市民のためのセキュリティ講座
jollyjoester
0
24
コミュニティMTG in WWDC24
jollyjoester
0
280
BengaluruでLTしてきた
jollyjoester
0
320
try! Swift Tokyo 2024
jollyjoester
0
310
エンジニアが直接会う場の価値について
jollyjoester
8
4.3k
来年Proposalを出すつもりで参加するときっともっと楽しい!
jollyjoester
0
340
My favorite sessions in WWDC 23
jollyjoester
0
630
みんなでAIと戯れよう
jollyjoester
0
140
続く勉強会の作り方
jollyjoester
2
850
Other Decks in Technology
See All in Technology
Whats_new_in_Podman_and_CRI-O_2025-06
orimanabu
3
160
技術職じゃない私がVibe Codingで感じた、AGIが身近になる未来
blueb
0
120
Tenstorrent HW/SW 概要説明
tenstorrent_japan
0
360
堅牢な認証基盤の実現 TypeScriptで代数的データ型を活用する
kakehashi
PRO
1
190
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
7.1k
Oracle Cloud Infrastructure IaaS 新機能アップデート 2025/03 - 2025/05
oracle4engineer
PRO
1
160
実践Kafka Streams 〜イベント駆動型アーキテクチャを添えて〜
joker1007
3
860
Go Connectへの想い
chiroruxx
0
160
データ戦略部門 紹介資料
sansan33
PRO
1
3.2k
Cloud Native Scalability for Internal Developer Platforms
hhiroshell
2
180
Amazon DevOps Guru のベースラインを整備して1ヶ月ほど運用してみた #jawsug_asa / Amazon DevOps Guru trial
masahirokawahara
3
240
エンジニア採用から始まる技術広報と組織づくり/202506lt
nishiuma
8
1.5k
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
228
22k
Code Reviewing Like a Champion
maltzj
524
40k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
640
The World Runs on Bad Software
bkeepers
PRO
68
11k
Build The Right Thing And Hit Your Dates
maggiecrowley
36
2.7k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.3k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
137
34k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
Site-Speed That Sticks
csswizardry
10
620
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