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
お金🤑をかけずにフィードバックフォームを構築しちゃう💪お話
Search
ayatk
March 31, 2018
Programming
2
1.2k
お金🤑をかけずにフィードバックフォームを構築しちゃう💪お話
Google Formsでフィードバックフォームを作っちゃおうってお話を2018年3月31日のLT会でやりました
ayatk
March 31, 2018
Tweet
Share
More Decks by ayatk
See All by ayatk
チーム開発 @ GitHub
ayatk
2
540
Android開発における自動化のすゝめ
ayatk
5
890
Other Decks in Programming
See All in Programming
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
Content Security Policy入門 セキュリティ設定と 違反レポートのはじめ方 / Introduction to Content Security Policy Getting Started with Security Configuration and Violation Reporting
uskey512
1
530
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
1.9k
役立つログに取り組もう
irof
28
9.6k
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.7k
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
540
Jakarta EE meets AI
ivargrimstad
0
600
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
290
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
470
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.1k
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
Featured
See All Featured
Making Projects Easy
brettharned
115
5.9k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
860
For a Future-Friendly Web
brad_frost
175
9.4k
A Philosophy of Restraint
colly
203
16k
Adopting Sorbet at Scale
ufuk
73
9.1k
A Tale of Four Properties
chriscoyier
156
23k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
GitHub's CSS Performance
jonrohan
1030
460k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Transcript
͓ۚΛ͔͚ͣʹ ϑΟʔυόοΫϑΥʔϜΛ ߏஙͪ͠Ό͏͓ @ayatk 2018/03/31
͜Μͳײ͡ͷਓ͕λʔήοτ • ࡞ͬͨΞϓϦׂ͕ͱμϯϩʔυ͞Ε͖ͯͨ(200ͱ ͔)͚ͲϢʔβʔ͔ΒͷϑΟʔυόοΫ͕গͳ͍ • ϑΟʔυόοΫͷͨΊʹ͍߹ΘͤϑΥʔϜతͳ ͷΛ࡞Γ͍͚ͨͲ͓͕ۚͳ͍ʂʂʂ • ΞϓϦͷຊ࣭͡Όͳ͍ͷͰͦΜͳʹ࿑ྗΛ͔͚ͨ͘ ͳ͍
ͦΜͳ͋ͳͨʹ!!!!!
ɹɹGoogle Forms ͕͋ΔΜͰ͢Α!!!
Google Forms ͬͯ͜Μͳͭ
• ΠϕϯτͷΞϯέʔτͩͬͨΓΛ؆୯ʹ࡞Ε ͯ؆୯ʹ৴Ͱ͖Δͭ • spreadsheetͰूܭ؆୯ • ཁ͢ΔʹGOD Google Forms ͬͯ͜Μͳͭ
࣮Google FormsɺURLΛ ୟ͍ͯճ͢Δ͜ͱՄೳ
https://docs.google.com/forms/d/e/ 1FAIpQLSeE52pcZ3cNRGTmDIdVDGE KBQlD-YOo62_fCh1Q1OXpnEvUmQ/ formResponse?entry. 134763060=%E3%81%BB%E3%81%9 2%E3%81%BB%E3%81%92%E3%81% BB%E3%81%92%E3%81%BB%E3%81 %92%E3%81%BB%E3%81%92 Let’s ΞΫηε
None
ճͷฤूը໘ΛݟΔͱʁ ͖ͬ͞ૹͬͨͭ
Կهೖͯ͠ͳ͍ͷʹճ͕ ه͞Εͯ͠·ͬͨ…
͜ΕΛAndroidʹΈࠐΊ λμͰαʔόϨεͳ ͍߹ΘͤγεςϜ͕Ͱ͖Δ
Δ͔͠Ͷ͐!!!!
࣮ࡍʹ࡞͍͖ͬͯ·͠ΐ͍
ϑΥʔϜΛ࡞Δ
ϑΥʔϜΛ࡞Δ • ͱΓ͋͑ͣϑΥʔϜΛ࡞Βͳ͖Ό͕࢝·Βͳ͍ • ϑΥʔϜϢʔβ͕ݟΔͷͰͳ͍ • ߥΒ͠ରࡦͷͨΊͷIPͩͬͨΓUAͩͬͨΓΛؚΊͯ ྑ͍ • ͨͩ͠ݸਓΛಛఆͰ͖ͳ͍ৗࣝͷൣғʹ͢Δ͜ͱʂʂ
(͍ͥͬͬͬͬͬͨʹి൪߸ύεϫʔυͱ͔ऩू͠ͳ͍)
None
࡞ͬͨ
͋ͷURLͲ͏ͬͯ ੜ͢Δͷʁ
A.ʮࣄલೖྗͨ͠URLΛऔಘʯ Ͱऔͬͯ͜ΕΔ
ͭ͜
URLΛੜ͢Δ
ʮࣄલೖྗͨ͠URLΛऔಘʯ ΛΫϦοΫ͠ɺదʹจࣈΛ ೖΕΔ
None
URLΛੜ͢Δ • ԼͷϦϯΫΛऔಘΛΫϦοΫ͢ΔͱɺԼʹʮϦ ϯΫΛίϐʔʯͱ͍͏ΫϦοΫͰ͖Δͷ͔Ͱ ͖ͳ͍ͷ͔Θ͔Βͳ͍Կ͔͕ग़ͯ͘ΔͷͰɺ ΫϦοΫ͢Δ
URLΛੜ͢Δ • ίϐʔ͢ΔͱҎԼͷΑ͏ͳURL͕Ͱ͖Δ https://docs.google.com/forms/d/e/ 1FAIpQLSdS6NK- K7HQ2xr8YqNWC3pOyf0WwbUxR7stpiux_H MmgdP3FA/viewform?usp=pp_url&entry. 2091053327=aaaa&entry. 682069554=wei&entry. 1656816265=A&entry.1013490606=hoo
URLղઆͷίʔφʔ • େࣄͳͷҎԼͷ3ͭͷཁૉ • ϑΥʔϜࣗମͷURL https://docs.google.com/forms/d/e/<ID>/ • ϑΥʔϜʹରͯ͠ͲͷΑ͏ͳૢ࡞Λ͢Δͷ͔ /<ID>/viewform •
ΫΤϦύϥϝʔλ /<ID>/viewform?entry.xxxx=hoge&entry.xxx=…
URLղઆͷίʔφʔ • ϑΥʔϜʹରͯ͠ͷૢ࡞ͰΑ͘ݟΔͷ͕ • viewform • edit • formResponse •
ࠓճ͍ͭ͜Λ͏
URLղઆͷίʔφʔ • ΫΤϦύϥϝʔλ • entry.xxxxͱͳΜͳͷ͔ • ֤ೖྗϑΥʔϜΛද͢ID • ׂͱϥϯμϜͬΆ͍ •
DevToolͰɺinputλάͷnameΛݟͯ֬ೝ͕Ͱ͖Δ • entry.xxxxʹೖΕ͍ͨจࣈྻબࢶͷจࣈྻΛURLΤϯίʔυͯ͠ ϦΫΤετΛ͛Δͱ͍͍ײ͡ʹͰ͖Δ
Androidʹ࣮͢Δ
Androidʹ࣮͢Δ • URLϕʔεͰͷճΫΤϦύϥϝʔλ͚ͩͰͳ ͘ɺPOSTϝιουͷϦΫΤετϘσΟͰͤΔ • POST͕ਖ਼نͷ࣮ͬΆ͍ • Δ͜ͱϕʔεͷ࣮ͱͯ͠POSTͷํ͕ҙຯత ʹ͋ͬͯͦ͏
Androidʹ࣮͢Δ • ͜Μͳײ͡ͷΛࢦ͢ • ViewΛ࡞Δͷ͕ͩΔ͍ͷ Ͱػೳ࠷খݶ
Service Interface interface FormService { @POST(“/forms/d/e/<Google-form-ID>/formResponse”) @FormUrlEncoded fun postForm( @Field("entry.2091053327")
hoge: String, @Field("entry.682069554") huga: String, // దʹIDݟͳ͕Β૿ͯ͠ཉ͍͠ ..... ): Single<Response<Void>> }
Form Client object FormClient { val service: FormService = Retrofit
.Builder() .client(OkHttpClient.Builder().build()) .baseUrl("https://docs.google.com/") .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .addConverterFactory(GsonConverterFactory.create()) .build() .create(FormService::class.java) }
࣮͢Δը໘ͷߏ Element: EditText ID: form Element: Button ID: submit
Main Activity override fun onCreate() { RxTextView.textChanges(form) .map { it.isNotBlank()
} .subscribe({ submit.isEnabled = it }) submit.setOnClickListener { FormClient.service .postForm(form.text.toString()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe({ /* ͳΜ͔৭ʑ͢Δ */}) .addTo(compositeDisposable) } }
DEEMMMMO
Google FormsͰ շదͳαʔόϨεڥΛ ࡞ͬͯߦ͖·ͬ͠ΐ͍
αϯϓϧ࡞ͬͨͷͰݟͯ https://github.com/ayatk/ google-form
ऴΘΓ