Upgrade to Pro — share decks privately, control downloads, hide ads and more …

お金🤑をかけずにフィードバックフォームを構築しちゃう💪お話

Feb988227afc260a31c195105ab9c55d?s=47 ayatk
March 31, 2018

 お金🤑をかけずにフィードバックフォームを構築しちゃう💪お話

Google Formsでフィードバックフォームを作っちゃおうってお話を2018年3月31日のLT会でやりました

Feb988227afc260a31c195105ab9c55d?s=128

ayatk

March 31, 2018
Tweet

Transcript

  1. ͓ۚΛ͔͚ͣʹ ϑΟʔυόοΫϑΥʔϜΛ ߏஙͪ͠Ό͏͓࿩ @ayatk 2018/03/31

  2. ͜Μͳײ͡ͷਓ͕λʔήοτ • ࡞ͬͨΞϓϦׂ͕ͱμ΢ϯϩʔυ͞Ε͖ͯͨ(200ͱ ͔)͚ͲϢʔβʔ͔ΒͷϑΟʔυόοΫ͕গͳ͍ • ϑΟʔυόοΫͷͨΊʹ໰͍߹ΘͤϑΥʔϜతͳ΋ ͷΛ࡞Γ͍͚ͨͲ͓͕ۚͳ͍ʂʂʂ • ΞϓϦͷຊ࣭͡Όͳ͍ͷͰͦΜͳʹ࿑ྗΛ͔͚ͨ͘ ͳ͍

  3. ͦΜͳ͋ͳͨʹ!!!!!

  4. ɹɹGoogle Forms ͕͋ΔΜͰ͢Α!!!

  5. Google Forms ͬͯ͜Μͳ΍ͭ

  6. • ΠϕϯτͷΞϯέʔτͩͬͨΓΛ؆୯ʹ࡞Ε ͯ؆୯ʹ഑৴Ͱ͖Δ΍ͭ • spreadsheetͰूܭ΋؆୯ • ཁ͢ΔʹGOD Google Forms ͬͯ͜Μͳ΍ͭ

  7. ࣮͸Google FormsɺURLΛ ୟ͍ͯճ౴͢Δ͜ͱ΋Մೳ

  8. 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 ΞΫηε

  9. None
  10. ճ౴ͷฤूը໘ΛݟΔͱʁ ͖ͬ͞ૹͬͨ΍ͭ

  11. Կ΋هೖͯ͠ͳ͍ͷʹճ౴͕ ه࿥͞Εͯ͠·ͬͨ…

  12. ͜ΕΛAndroidʹ૊ΈࠐΊ͹ λμͰαʔόϨεͳ ໰͍߹ΘͤγεςϜ͕Ͱ͖Δ

  13. ΍Δ͔͠Ͷ͐!!!!

  14. ࣮ࡍʹ࡞͍͖ͬͯ·͠ΐ͍

  15. ϑΥʔϜΛ࡞Δ

  16. ϑΥʔϜΛ࡞Δ • ͱΓ͋͑ͣϑΥʔϜΛ࡞Βͳ͖Ό࿩͕࢝·Βͳ͍ • ϑΥʔϜ͸Ϣʔβ͕௚઀ݟΔ΋ͷͰ͸ͳ͍ • ߥΒ͠ରࡦͷͨΊͷIPͩͬͨΓUAͩͬͨΓΛؚΊͯ΋ ྑ͍ • ͨͩ͠ݸਓΛಛఆͰ͖ͳ͍ৗࣝͷൣғ಺ʹ͢Δ͜ͱʂʂ


    (͍ͥͬͬͬͬͬͨʹి࿩൪߸΍ύεϫʔυͱ͔ऩू͠ͳ͍)
  17. None
  18. ࡞ͬͨ

  19. ͋ͷURL͸Ͳ͏΍ͬͯ ੜ੒͢Δͷʁ

  20. A.ʮࣄલೖྗͨ͠URLΛऔಘʯ Ͱऔͬͯ͜ΕΔ

  21. ͜΍ͭ

  22. URLΛੜ੒͢Δ

  23. ʮࣄલೖྗͨ͠URLΛऔಘʯ ΛΫϦοΫ͠ɺద౰ʹจࣈΛ ೖΕΔ

  24. None
  25. URLΛੜ੒͢Δ • ԼͷϦϯΫΛऔಘΛΫϦοΫ͢ΔͱɺԼʹʮϦ ϯΫΛίϐʔʯͱ͍͏ΫϦοΫͰ͖Δͷ͔Ͱ ͖ͳ͍ͷ͔Θ͔Βͳ͍Կ͔͕ग़ͯ͘ΔͷͰɺ ΫϦοΫ͢Δ

  26. 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

  27. URLղઆͷίʔφʔ • େࣄͳͷ͸ҎԼͷ3ͭͷཁૉ • ϑΥʔϜࣗମͷURL
 https://docs.google.com/forms/d/e/<ID>/ • ϑΥʔϜʹରͯ͠ͲͷΑ͏ͳૢ࡞Λ͢Δͷ͔
 /<ID>/viewform •

    ΫΤϦύϥϝʔλ
 /<ID>/viewform?entry.xxxx=hoge&entry.xxx=…
  28. URLղઆͷίʔφʔ • ϑΥʔϜʹରͯ͠ͷૢ࡞ͰΑ͘ݟΔͷ͕ • viewform • edit • formResponse •

    ࠓճ͸͍ͭ͜Λ࢖͏
  29. URLղઆͷίʔφʔ • ΫΤϦύϥϝʔλ • entry.xxxxͱ͸ͳΜͳͷ͔ • ֤ೖྗϑΥʔϜΛද͢ID • ׂͱϥϯμϜͬΆ͍ •

    DevToolͰɺinputλάͷnameΛݟͯ΋֬ೝ͕Ͱ͖Δ • entry.xxxxʹೖΕ͍ͨจࣈྻ΍બ୒ࢶͷจࣈྻΛURLΤϯίʔυͯ͠ ϦΫΤετΛ౤͛Δͱ͍͍ײ͡ʹͰ͖Δ
  30. Androidʹ࣮૷͢Δ

  31. Androidʹ࣮૷͢Δ • URLϕʔεͰͷճ౴͸ΫΤϦύϥϝʔλ͚ͩͰͳ ͘ɺPOSTϝιουͷϦΫΤετϘσΟͰ΋౉ͤΔ • POST͕ਖ਼نͷ࣮૷ͬΆ͍ • ΍Δ͜ͱϕʔεͷ࣮૷ͱͯ͠͸POSTͷํ͕ҙຯత ʹ͋ͬͯͦ͏

  32. Androidʹ࣮૷͢Δ • ͜Μͳײ͡ͷΛ໨ࢦ͢ • ViewΛ࡞Δͷ͕ͩΔ͍ͷ Ͱػೳ͸࠷খݶ

  33. 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>> }
  34. 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) }
  35. ࣮૷͢Δը໘ͷߏ੒ Element: EditText
 ID: form Element: Button
 ID: submit

  36. 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) } }
  37. DEEMMMMO

  38. Google FormsͰ շదͳαʔόϨε؀ڥΛ ࡞ͬͯߦ͖·ͬ͠ΐ͍

  39. αϯϓϧ࡞ͬͨͷͰݟͯ https://github.com/ayatk/ google-form

  40. ऴΘΓ