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.1k
お金🤑をかけずにフィードバックフォームを構築しちゃう💪お話
Google Formsでフィードバックフォームを作っちゃおうってお話を2018年3月31日のLT会でやりました
ayatk
March 31, 2018
Tweet
Share
More Decks by ayatk
See All by ayatk
チーム開発 @ GitHub
ayatk
2
520
Android開発における自動化のすゝめ
ayatk
5
850
Other Decks in Programming
See All in Programming
IntelliJ IDEA を知らなかった 自分に教えたい小ネタ集 / IntelliJ IDEA Hints for My Past Self
mackey0225
3
180
せっかくモデル図描くのなら、嬉しいことが多い方がいいよね!
kuboaki
1
1.8k
チームでモデリングを育てるうえで 考えたこと・気づいたこと / Cultivating Modeling in Teams: Thoughts and Insights
mackey0225
5
2.4k
Go1.22からの疑似乱数生成器について/go-122-pseudo-random-generator
convto
1
160
Learning PHP and Static Analysis with PHP Parser
inouehi
1
250
複雑なドメインを扱うプロダクトの探索フェーズではいつどのようにテストをするのか / How to testing during exploratory phase
boykush
2
150
C# 大統一理論推進委員会 会員のための Unity Package Manager プロジェクト構成案
monry
PRO
0
580
両面どころかインフラもTSでできるよ ~ 全方位TypeScriptによるプロダクト開発 ~
myfinder
9
2.5k
Enhancing Applications with Accessibility API
kishikawakatsumi
3
1k
document.write再考
brn
5
2.5k
もうすぐ新年度、Babylon.jsがお勧めな3個の理由
hideg
0
170
Deno に Web 標準 API を実装する / Implementing Web Standard API to Deno
petamoriken
0
350
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
455
32k
VelocityConf: Rendering Performance Case Studies
addyosmani
319
23k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
11
1.4k
Rails Girls Zürich Keynote
gr2m
91
13k
Documentation Writing (for coders)
carmenintech
59
3.8k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
5
1.4k
WebSockets: Embracing the real-time Web
robhawkes
59
6.9k
[RailsConf 2023] Rails as a piece of cake
palkan
21
3.8k
Bash Introduction
62gerente
604
210k
Designing on Purpose - Digital PM Summit 2013
jponch
109
6.4k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
185
15k
RailsConf 2023
tenderlove
0
510
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
ऴΘΓ