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

生体データを取り扱うアプリ開発の勘所

 生体データを取り扱うアプリ開発の勘所

Kohei Tabata

July 11, 2019
Tweet

More Decks by Kohei Tabata

Other Decks in Programming

Transcript

  1. ੜମσʔλΛऔΓѻ͏

    ΞϓϦ։ൃͷצॴ
    Health Tech0.5
    @TIME SHARINGौ୩Ӊా઒ொ
    Kohei Tabata

    View full-size slide

  2. ࣗݾ঺հ
    ➤ ాാߒฏ(@nerd0geek1)
    ➤ iOS Engineer @ Saib Studio LLC
    ➤ ڈ೥ͷ11݄͔ΒiOSΞϓϦશମͷ։ൃΛ͓ख఻͍͍ͯ͠·͢ɻ
    ➤ ࠷ۙ͸σβΠϯ΋ษڧͯ͠ޱग़ͨ͠͠Γͯ͠·͢ɻ

    View full-size slide

  3. ઃܭࢥ૝ͷಋೖͱϦϑΝΫλϦϯάʁ
    ΞϥʔϜɺλΠϚʔػߏʁ

    (Timer, UNNotificationRequest)
    Clean Architecture x RxSwiftʁ
    fastlane x CircleCIʹΑΔCI/CDͷಋೖʁ

    View full-size slide

  4. Ͱ΋ɺϔϧεέΞاۀ͡Όͳͯ͘΋
    Ͱ͖ΔΑͶʁ

    View full-size slide

  5. ΞδΣϯμ
    ➤ ੜମσʔλ × औಘ
    ➤ ϑΟʔυόοΫαΠΫϧେ͖͗͢໰୊(ਭ຾ͷ৔߹͸Ұ൩)
    ➤ ͦ͜ʹؔ͢Δ෦෼ͷ։ൃ͕ϘτϧωοΫʹͳΓ͕ͪ
    ➤ ੜମσʔλ × ෼ੳ
    ➤ ੜσʔλ͸σʔλ༰ྔΛצҊͭͭ͠ɺղ૾౓ߴ͘औಘ͓ͯ͘͠

    View full-size slide

  6. ੜମσʔλ͸औಘ͕େม
    σʔλܭଌ։࢝
    σʔλ෼ੳ

    (ΫϥΠΞϯτ)
    σʔλ෼ੳ

    (αʔό)

    View full-size slide

  7. ੜମσʔλ͸औಘ͕େม
    σʔλܭଌ։࢝
    σʔλ෼ੳ

    (ΫϥΠΞϯτ)
    σʔλ෼ੳ

    (αʔό)
    ਺े෼ʙҰ൩

    View full-size slide

  8. ੜମσʔλ͸औಘ͕େมɺੜ੒΋Ͱ͖ͳ͍
    ➤ O:SLEEPͷ৔߹͸جຊతͳϢʔεέʔε͕Ұ൩

    (෼ੳͷͨΊʹ͸ɺ࠷௿ݶͰ΋਺े෼ͷσʔλ͕ඞཁ)
    ➤ ؔ࿈͢Δػೳɾը໘ͷ։ൃͰεϐʔυ͕ग़ͤͳ͍
    ➤ ਭ຾෼ੳϞδϡʔϧͷݕূ
    ➤ ਭ຾ܭଌޙͷը໘ભҠ
    ➤ etc…
    ϓϩμΫτ։ൃ͸͍͔ʹߴ଎ʹ։ൃͱݕূΛਐΊΔ͔͕
    ΩϞͳͷʹ

    View full-size slide

  9. ։ൃΛߴ଎Խ͢ΔͨΊʹԿΛ͔ͨ͠ʁ
    ➤ ໰୊Λ੔ཧ͢Δͱ2ͭɻ
    ➤ ਭ຾෼ੳϞδϡʔϧͷϩδοΫͷਖ਼͠͞ΛݕূͰ͖͍ͯͳ͍
    ➤ ਭ຾ΛؚΉը໘ભҠɾϑϩʔͷݕূʹ͕͔͔࣌ؒΓ͗͢Δ

    View full-size slide

  10. ਭ຾෼ੳϞδϡʔϧͷਖ਼͠͞ͷݕূ
    ➤ Ϣχοτςετͷ௥Ճ
    ➤ ਺೔෼ͷਭ຾σʔλΛ஝ੵ
    ➤ Ϣχοτςετ͕͠΍͍͢Α͏ʹɺΫϥε֎ʹެ։͢ΔϝιουΛมߋ
    ➤ ਭ຾σʔλΛݩʹݕূ༻ͷμϛʔσʔλΛ࡞੒

    View full-size slide

  11. ը໘ભҠɺϑϩʔͷݕূ
    ➤ ίʔυͷॻ͖׵͑ɺμϛʔσʔλͰ৐Γ੾Δ
    ➤ ϐϯϙΠϯτͰͷը໘ભҠݕূ͸खݩͰίʔυΛॻ͖׵͑Δ͜ͱͰରԠ
    ➤ ը໘ભҠʹσʔλ͕ඞཁͳ৔߹͸ɺࣗ෼ͷաڈʹ஝ੵͨ͠ਭ຾σʔλΛ

    ͖࣋ͬͯͯɺ೔෇͚ͩมߋͯ͠ར༻͢Δ
    ➤ ։ൃνʔϜશମͷߴ଎Խ͕ඞཁʹͳͬͨ৔߹ɺ͜ͷ͋ͨΓ΋

    σόοάػೳͱͯ͠࡞͍͔ͬͯ͘΋…ʁ

    View full-size slide

  12. ੜମσʔλ͸෼ੳ΋େม
    ➤ O: ͷΞϧΰϦζϜ͸৸ฦΓʹΑΔମಈ = Ճ଎౓Λϕʔεͱ

    ͨ͠΋ͷ
    ➤ ԾʹɺࠓͷΞϧΰϦζϜΑΓྑ͍ΞϧΰϦζϜΛ։ൃͨ͠

    ৔߹ɺͦΕ͕Ͳ͏͍ͬͨ݁ՌͱͳΔͷ͔ɺ਺೔~਺िؒ଴ͨ
    ͣʹݕূ͍ͨ͠ɻ


    View full-size slide

  13. ੜσʔλΛDBʹอ࣋͢Ε͹ྑ͍ͷͰ͸ʁ
    ➤ ݱঢ়ͷΞϓϦͰ͸ɺ਺ඵ͝ͱʹҎԼͷ஋Λऔಘ͠ɺͦΕΛ

    ىচ࣌఺Ͱ෼ੳɺ෼ੳ݁ՌͷΈΛαʔόʹૹ৴͍ͯ͠Δɻ
    ➤ time(Date)
    ➤ x(Double)
    ➤ y(Double)
    ➤ z(Double)
    ➤ ͜ͷੜσʔλΛղ૾౓ߴ͍ঢ়ଶͰRealmʹอ࣋͢Ε͹

    ྑ͍ͷͰ͸ʁ

    View full-size slide

  14. ͨͩ͠…
    ➤ Ճ଎౓৘ใͷੜσʔλ͸Ϩίʔυ਺͕͔ͳΓଟ͍ɻ
    ➤ 1ϨίʔυʹҎԼͷ৘ใؚ͕·ΕΔɻ
    ➤ time(Date, 8byte)
    ➤ x(Double, 8byte)
    ➤ y(Double, 8byte)
    ➤ z(Double, 8byte)
    ➤ 1ඵຖɺ6࣌ؒਭ຾ͱͯ͠

    60 * 60 * 6 * 8 * 4 = 691200Byte ≒ 700kB
    ➤ 0.1ඵຖͩͱ

    60 * 60 * 6 * 10 * 8 * 4 = 6912000Byte ≒ 7MB


    View full-size slide

  15. ͳͷͰ
    ➤ ϑΝΠϧαΠζ͕େ͖͘ͳΓ͗͢ͳ͍Α͏ʹ؅ཧ
    ➤ ۩ମతʹ͸
    ➤ ੜσʔλ͸௚ۙ30೔෼ͷΈΛอ࣋͢ΔΑ͏ʹ࣮૷
    ➤ 30೔Λ௒͑Δ෼ʹ͍ͭͯ͸ݹ͍΋ͷ͔Βফ͍ͯ͘͠

    View full-size slide

  16. ·ͱΊ
    ➤ ੜମσʔλΛऔΓѻ͏ΞϓϦͱ͍ͬͯ΋جຊ͸มΘΒͳ͍
    ➤ ͨͩ͠ɺऔΓѻ͏σʔλͷಛੑ͕ଞͷΞϓϦͱେ͖͘ҟͳΔ

    (औಘɺੜ੒͕ࠔ೉)
    ➤ طଘͷΞϓϦ։ൃͰಘͨ஌ࣝΛ༻͍ͯɺͦ͏͍ͬͨಛघੑʹ

    ཱͪ޲͔͏

    View full-size slide