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
420
0
Share
Using Google Maps Platform with idiomatic Kotlinまとめ
集まれKotlin好き!Kotlin愛好会 vol.30 @オンライン
https://love-kotlin.connpass.com/event/218515/
jollyjoester
July 21, 2021
More Decks by jollyjoester
See All by jollyjoester
印西市創業実践プログラム2026 【AI活用講座】
jollyjoester
0
12
AI時代でも変わらない技術コミュニティの力 ~10年続く"ゆるい"つながりが生み出す価値~
jollyjoester
0
10
AIコードアシスタントとiOS開発
jollyjoester
1
350
市民のためのセキュリティ講座
jollyjoester
0
78
コミュニティMTG in WWDC24
jollyjoester
0
340
BengaluruでLTしてきた
jollyjoester
0
390
try! Swift Tokyo 2024
jollyjoester
0
380
エンジニアが直接会う場の価値について
jollyjoester
8
4.6k
来年Proposalを出すつもりで参加するときっともっと楽しい!
jollyjoester
0
410
Other Decks in Technology
See All in Technology
推し活エージェント
yuntan_t
1
900
NgRx SignalStore: The Power of Extensibility
rainerhahnekamp
0
190
🀄️ on swiftc
giginet
PRO
0
290
Cortex Codeでデータの仕事を全部Agenticにやりきろう!
gappy50
0
350
システムは「動く」だけでは 足りない - 非機能要件・分散システム・トレードオフの基礎
nwiizo
25
7.9k
主催・運営として"場をつくる”というアウトプットのススメ
_mossann_t
0
130
AIペネトレーションテスト・ セキュリティ検証「AgenticSec」ご紹介資料
laysakura
0
1.6k
20260410 - CNTUG meetup #72 - DiskImage Builder 介紹:以 Kubespray CI 打造 RockyLinux 10 Cloud Image 為例
tico88612
0
110
制約を設計する - 非決定性との境界線 / Designing constraints
soudai
PRO
6
2.4k
Databricksを用いたセキュアなデータ基盤構築とAIプロダクトへの応用.pdf
pkshadeck
PRO
0
260
Hello UUID
mimifuwacc
0
130
デシリアライゼーションを理解する / Inside Deserialization
tomzoh
0
230
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
A designer walks into a library…
pauljervisheath
211
24k
Designing for Timeless Needs
cassininazir
0
190
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
170
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
160
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
510
Practical Orchestrator
shlominoach
191
11k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
Code Review Best Practice
trishagee
74
20k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
500
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