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
14
コミュニティMTG in WWDC24
jollyjoester
0
270
BengaluruでLTしてきた
jollyjoester
0
300
try! Swift Tokyo 2024
jollyjoester
0
290
エンジニアが直接会う場の価値について
jollyjoester
8
4.2k
来年Proposalを出すつもりで参加するときっともっと楽しい!
jollyjoester
0
330
My favorite sessions in WWDC 23
jollyjoester
0
610
みんなでAIと戯れよう
jollyjoester
0
130
続く勉強会の作り方
jollyjoester
2
840
Other Decks in Technology
See All in Technology
Cross Data Platforms Meetup LT 20250422
tarotaro0129
0
190
アジャイル脅威モデリング#1(脅威モデリングナイト#8)
masakane55
3
190
20250411_HCCJP_AdaptiveCloudUpdates.pdf
sdosamut
1
110
Vision Pro X Text to 3D Model ~How Swift and Generative Al Unlock a New Era of Spatial Computing~
igaryo0506
0
260
Would you THINK such a demonstration interesting ?
shumpei3
1
210
技術者はかっこいいものだ!!~キルラキルから学んだエンジニアの生き方~
masakiokuda
2
250
AIと開発者の共創: エージェント時代におけるAIフレンドリーなDevOpsの実践
bicstone
1
300
DuckDB MCPサーバーを使ってAWSコストを分析させてみた / AWS cost analysis with DuckDB MCP server
masahirokawahara
0
1.2k
【2025年度新卒技術研修】100分で学ぶ サイバーエージェントのデータベース 活用事例とMySQLパフォーマンス調査
cyberagentdevelopers
PRO
5
7.2k
AIコーディングの最前線 〜活用のコツと課題〜
pharma_x_tech
1
370
バックオフィス向け toB SaaS バクラクにおけるレコメンド技術活用 / recommender-systems-in-layerx-bakuraku
yuya4
5
520
クォータ監視、AWS Organizations環境でも楽勝です✌️
iwamot
PRO
1
280
Featured
See All Featured
Facilitating Awesome Meetings
lara
54
6.3k
Why Our Code Smells
bkeepers
PRO
336
57k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
178
53k
Raft: Consensus for Rubyists
vanstee
137
6.9k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.4k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
21k
GraphQLとの向き合い方2022年版
quramy
46
14k
Writing Fast Ruby
sferik
628
61k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.3k
[RailsConf 2023] Rails as a piece of cake
palkan
54
5.4k
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