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
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.2k
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
250
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
Tauriでネイティブアプリを作りたい
tsucchinoko
0
380
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
360
みんなでプロポーザルを書いてみた
yuriko1211
0
280
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
610
flutterkaigi_2024.pdf
kyoheig3
0
170
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
DevTools extensions で 独自の DevTool を開発する | FlutterKaigi 2024
kokiyoshida
0
120
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.8k
Click-free releases & the making of a CLI app
oheyadam
2
120
Featured
See All Featured
Building Adaptive Systems
keathley
38
2.3k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
Side Projects
sachag
452
42k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Speed Design
sergeychernyshev
25
620
KATA
mclloyd
29
14k
4 Signs Your Business is Dying
shpigford
180
21k
Designing the Hi-DPI Web
ddemaree
280
34k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
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
ऴΘΓ