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
900
Other Decks in Programming
See All in Programming
ファインディの テックブログ爆誕までの軌跡
starfish719
1
670
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
410
HTML/CSS超絶浅い説明
yuki0329
0
200
CloudNativePGがCNCF Sandboxプロジェクトになったぞ! 〜CloudNativePGの仕組みの紹介〜
nnaka2992
0
150
.NETでOBS Studio操作してみたけど…… / Operating OBS Studio by .NET
skasweb
0
130
Swiftコンパイラ超入門+async関数の仕組み
shiz
0
190
Linux && Docker 研修/Linux && Docker training
forrep
16
3.3k
動作確認やテストで漏れがちな観点3選
starfish719
5
720
watsonx.ai Dojo #6 継続的なAIアプリ開発と展開
oniak3ibm
PRO
0
250
ペアーズでの、Langfuseを中心とした評価ドリブンなリリースサイクルのご紹介
fukubaka0825
1
170
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
180
AWS Lambda functions with C# 用の Dev Container Template を作ってみた件
mappie_kochi
0
210
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
A Philosophy of Restraint
colly
203
16k
Code Reviewing Like a Champion
maltzj
521
39k
Side Projects
sachag
452
42k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
11
890
The Cult of Friendly URLs
andyhume
78
6.2k
Building Your Own Lightsaber
phodgson
104
6.2k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.2k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
For a Future-Friendly Web
brad_frost
176
9.5k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
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
ऴΘΓ