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

Jetpack Composeでアプリを開発して遭遇した問題

37618b4d60cf3d1f43f7196253264edc?s=47 Nabe
February 22, 2022

Jetpack Composeでアプリを開発して遭遇した問題

2022/02/22
Mobile勉強会 Wantedly × チームラボ #4
https://connpass.com/event/237606/

37618b4d60cf3d1f43f7196253264edc?s=128

Nabe

February 22, 2022
Tweet

More Decks by Nabe

Other Decks in Programming

Transcript

  1.  .PCJMFษڧձ8BOUFEMZYνʔϜϥϘ ,B[VLJ8BUBOBCF +FUQBDL$PNQPTFͰΞϓϦΛ ։ൃͯ͠ૺ۰ͨ͠໰୊

  2. 1SPGJMF w ͳ΂ w 5XJUUFS!/BCF$PUU w (JU)VC/6NFSP"OE%FW w גࣜձࣾ͸ͯͳ w

    "OESPJEJ04BQQMJDBUJPOFOHJOFFS
  3. 'VMM+FUQBDL$PNQPTFͰ։ൃͨ͠ΞϓϦ Λࡢ೥ϦϦʔε͠·ͨ͠

  4. IUUQTIBUFOBDPSQKQQSFTTSFMFBTFFOUSZ

  5. IUUQTEFWFMPQFSIBUFOBTUB ff DPNFOUSZ

  6. ࠓ೔࿩͢͜ͱ w +FUQBDL$PNQPTFͰΞϓϦΛ։ൃͯ͠ૺ۰ͨ͠໰୊఺ͱͲ͏ରॲͨ͠ͷ͔ w ϨΠΞ΢ταΠζऔಘͰύϑΥʔϚϯε௿Լ w ด͡ΒΕͳ͍%SPQEPXO.FOV w άϦου͔͠දࣔͰ͖ͳ͍-B[Z(SJE w

    ߋ৽Ͱ͖ͳ͍"DDPNQBOJTU1BHFS
  7. ϨΠΞ΢ταΠζऔಘͰύϑΥʔϚϯε௿ Լٙ࿭

  8. ϨΠΞ΢ταΠζऔಘͰύϑΥʔϚϯε௿Լٙ࿭ ֓ཁ w "OESPJE7JFXͰϨΠΞ΢τͷαΠζΛऔΖ͏ͱ͢Δͱ 0O(MPCBM-BZPVU-JTUFOFSͷλΠϛϯάͰऔΔͱ͍͏ํ๏͕͋Δ w $PNQPTFͰ΋.PEJ fi FSPO4J[F$IBOHFEͰಉ͡Α͏ͳ͜ͱ͕Ͱ͖Δ w

    "OESPJE7JFXͱಉ͡Α͏ͳ࣮૷Λ͢ΔͱඞཁҎ্ʹ3FDPNQPTF͞ΕΔΑ ͏ʹͳͬͨ w ໨ʹݟ͑ͯύϑΥʔϚϯε͕མ͍ͪͯͨΘ͚Ͱ͸ͳ͍
  9. ϨΠΞ΢ταΠζऔಘͰύϑΥʔϚϯε௿Լٙ࿭ ֓ཁ

  10. ϨΠΞ΢ταΠζऔಘͰύϑΥʔϚϯε௿Լٙ࿭ ݪҼ w $PNQPTJUJPOˠ-BZPVUˠ%SBXJOHͱ͍ͬͨྲྀΕͰ$PNQPTF͸ϨΠΞ΢τ ͞ΕΔ w .PEJ fi FSPO4J[F$IBOHFEͰ஋Λड͚औΔͷ͸-BZPVUͷλΠϛϯάͰɺड ͚औͬͨ஋Λผͷ$PNQPTBCMFʹ౉͢ͱ%SBXJOH͕͞Εͨޙʹ

    3FDPNQPTF͞Εͯ$PNQPTJUJPO͔Β࠶ϨΠΞ΢τ͞ΕΔ w ͜Ε͕ෳ਺ͷՕॴͰ࣮૷͞Ε͍ͯͨΓར༻͞Ε͍ͯΔͱύϑΥʔϚϯεͷ௿ Լʹͭͳ͕Δ
  11. ϨΠΞ΢ταΠζऔಘͰύϑΥʔϚϯε௿Լٙ࿭ ରॲ w ࣗ਎΍਌ϨΠΞ΢τͷαΠζΛऔΔ͚ͩͳΒ#PY8JUI$POTUSBJOUΛ࢖͏ w ϨΠΞ΢τͷαΠζ͕ඞཁʹͳΔෳࡶͳϨΠΞ΢τͷ৔߹͸ΧελϜϨΠΞ ΢τΛ࡞Δ

  12. ด͡ΒΕͳ͍%SPQEPXO.FOV

  13. ด͡ΒΕͳ͍%SPQEPXO.FOV ֓ཁ w -JHIU5IFNF%BSL5IFNFͷ੾Γସ͑Λ%SPQEPXO.FOVͷ $PNQPTBCMFΛ࢖࣮ͬͯ૷ͨ͠ w ςʔϚ͕੾ΓସΘΔͱ%SPQEPXO.FOV͕࢒Γଓ͚ͨ

  14. ด͡ΒΕͳ͍%SPQEPXO.FOV ֓ཁ

  15. ด͡ΒΕͳ͍%SPQEPXO.FOV ݪҼ w $PNQPTFͷ%SPQEPXO.FOV͸಺෦Ͱ8JOEPXʹ7JFXΛஔ͍ͯද͍ࣔͤͯ͞Δ w %SPQEPXO.FOV͕ด͡ΒΕΔ࣌͸8JOEPX͔Β7JFXΛऔΓআ͘ॲཧΛݺΜͰ͍ Δ w ͜͜ͰςʔϚ੾Γସ͑࣌ʹ͸SFDSFBUF͕಺෦ͰߦΘΕΔ w

    8JOEPX͔Β7JFXΛऔΓআ͘ॲཧ͕ऴΘΔલʹSFDSFBUF͕ߦΘΕͯ %SPQEPXO.FOV͕࢒ͬͯ͠·͏ w %SPQEPXO.FOVͷঢ়ଶͰ͋ΔFYQBOEFE͸GBMTF͕ͩ಺෦ॲཧ໋͕ྩతͰ͋Δ ͨΊζϨ͕ى͖Δ
  16. ด͡ΒΕͳ͍%SPQEPXO.FOV ରॲ w ςʔϚ੾Γସ͑ͷॲཧͷલʹEFMBZΛೖΕͯ%SPQEPXO.FOV͕ด͡ΒΕͯ ͍ΔͰ͋Ζ͏λΠϛϯάͰSFDSFBUF͕ߦΘΕΔΑ͏λΠϛϯάΛ஗Βͤ·͠ ͨ

  17. άϦου͔͠දࣔͰ͖ͳ͍-B[Z(SJE

  18. άϦου͔͠දࣔͰ͖ͳ͍-B[Z(SJE ରॲ w -B[Z7FSUJDBM(SJE-B[Z)PSJ[POUBM(SJEͰ͸ΞΠςϜͷ4QBO͕ઃఆͰ͖ͳ ͍ w άϦουͷؒʹԣ෯͍ͬͺ͍ͷηΫγϣϯΛදࣔͰ͖ͳ͍

  19. άϦου͔͠දࣔͰ͖ͳ͍-B[Z(SJE ରॲ w -B[Z$PMVNO-B[Z3PXͷΞΠςϜͷϨΠΞ΢τΛ޻෉ͯ͠ηΫγϣϯͱά ϦουΛࠞͥͯදࣔͰ͖ΔΑ͏ʹͨ͠ w BMQIBͰ(SJE4QBO*UFN͕௥Ճ͞Εͯ4QBOͷઃఆ͕Ͱ͖ΔΑ͏ʹ ͳͬͨ w BMQIB࣌఺Ͱ͸ࢥͬͨΑ͏ʹ4QBOͷڍಈ͕ಈ͍ͯ͘Εͳ͍ͷͰࠓޙʹ

    ظ଴
  20. ߋ৽Ͱ͖ͳ͍"DDPNQBOJTU1BHFS

  21. ߋ৽Ͱ͖ͳ͍"DDPNQBOJTU1BHFS ֓ཁ w "DDPNQBOJTU1BHFSͰ಺෦࣮૷͕ΧελϜϨΠΞ΢τ͔Β -B[Z$PMVNO-B[Z3PXʹมΘͬͨ w ͦͷӨڹͰ"1*΋େ͖͘มΘͬͨ w P ff

    TFUɺFOBCMF%SBHɺແݶϧʔϓͷ"1*࡟আ w Ҡߦޙͷແݶϧʔϓ1BHFSͷ࣮૷Ͱ͸5BCͷΠϯδέʔλͷ࿈ܞ͕Ͱ͖ͳ ͍
  22. ߋ৽Ͱ͖ͳ͍"DDPNQBOJTU1BHFS ରॲ w P ff TFUͷ஋Λݩʑେ͖͘ઃఆ͍ͯͨ͠Θ͚Ͱ͸ͳ͍ͷͰɺ-B[ZܥͷڍಈͰ΋େ͖ͳ͕ࠩͳ͔ͬͨ w FOBCMF%SBHͷ୅ΘΓʹ-B[ZܥͷεΫϩʔϧྔΛʹ͢Δ.PEJ fi FSΛ࣮૷ͯͦ͠ΕΛར༻ͨ͠

    w Ͱ-B[ZܥʹVTFS4DSPMM&OBCMFEͷΦϓγϣϯ͕૿͑ͨͷͰ͜Ε͕1BHFSͰ΋࢖͑Δ Α͏ʹͳΔ͔΋
  23. ߋ৽Ͱ͖ͳ͍"DDPNQBOJTU1BHFS ରॲ w ແݶϧʔϓ͸1BHFSͷαϯϓϧίʔυΛࢀߟʹ࣮૷ w 5BCͷΠϯδέʔλΛແݶϧʔϓͰ΋࢖͑ΔΑ͏ʹίʔυΛ࣮૷ w ͦ͏͢ΔͱΠϯδέʔλͷΞχϝʔγϣϯ͕࢖͑ͳ͍໰୊͕ग़ͯ͘ΔͷͰ࣍ͷ ͲͪΒ͔Ͱճආ͢Δඞཁ͕͋ͬͨ w

    ແݶϧʔϓΛ΍Ίͯ5BCͷΠϯδέʔλͷΞχϝʔγϣϯΛ࢒͢ w 5BCͷΠϯδέʔλͷΞχϝʔγϣϯΛఘΊͯແݶϧʔϓΛ࢒͢ w νʔϜͰ࿩͠߹ͬͯޙऀͰҠߦΛਐΊͨ
  24. ·ͱΊ w ৽͍ٕ͠ज़ͱ͍͏͜ͱ΋͋Γɺෆ଍͍ͯ͠Δػೳ΍େ͖ͳ"1*ͷมߋ͸Α͘ ͋ͬͨ w ৭ʑ໰୊ʹૺ۰͸ͨ͠΋ͷͷ+FUQBDL$PNQPTFΛ༻͍ͨ։ൃ͸շద w +FUQBDL$PNQPTFͷॊೈͳ"1*ͱએݴత6*ͱ͍͏ঢ়ଶ؅ཧ͔Βͷղ์

  25. એ఻ w ͸ͯͳͰ͸J04"OESPJEΞϓϦΤϯδχΞΛ࠾༻͍ͯ͠·͢ʂ w ΧδϡΞϧͳ໘ஊ΋Ͱ͖ΔͷͰͥͻؾܰʹ͓੠͕͚͍ͩ͘͞ʂ https://open.talentio.com/r/1/c/hatena/pages/28838

  26. ࢀߟ w ϨΠΞ΢ταΠζऔಘͰύϑΥʔϚϯε௿Լٙ࿭ w IUUQTEFWFMPQFSBOESPJEDPNKFUQBDLDPNQPTFQIBTFTSFDPNQ MPPQ w άϦου͔͠දࣔͰ͖ͳ͍-B[Z(SJE w IUUQTBOESPJESFWJFXHPPHMFTPVSDFDPNDQMBUGPSNGSBNFXPSLT

    TVQQPSU  w ߋ৽Ͱ͖ͳ͍"DDPNQBOJTU1BHFS w IUUQTHJUIVCDPNHPPHMFBDDPNQBOJTU w IUUQTBOESPJESFWJFXHPPHMFTPVSDFDPNDQMBUGPSNGSBNFXPSLT TVQQPSU 
  27. 5IBOLZPV