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

実践 WorkManager / WorkManager

atsushisakai
February 08, 2019

実践 WorkManager / WorkManager

DroidKaigi 2019の登壇資料です。
こちらの詳細はブログエントリにもまとめていますので合わせてご覧ください。
https://medium.com/mixi-developers/%E5%AE%9F%E8%B7%B5-workmanager-ea9344bf09a3

atsushisakai

February 08, 2019
Tweet

More Decks by atsushisakai

Other Decks in Programming

Transcript

  1. ࣮૷ 4 Synchronizer Server/CDN SQLite WorkManager Worker Glide Synchronizer Server/CDN

    SQLite WorkManager Worker Glide Request Metadata Response Metadata Save Metadata Enqueue Job Cache Image Select Metadata Request Image Response Image Execute Job
  2. ࣮૷ 4 Synchronizer Server/CDN SQLite WorkManager Worker Glide Synchronizer Server/CDN

    SQLite WorkManager Worker Glide Request Metadata Response Metadata Save Metadata Enqueue Job Cache Image Select Metadata Request Image Response Image Execute Job
  3. ϦτϥΠͷڍಈΛཧղ͢Δ • σϑΥϧτ͸BackoffPolicy.EXPONENTIAL • WorkSpec#calculateNextRunTime ΛಡΉͱΞϧΰϦζϜΛཧղͰ͖Δɻ • ࠷ऴతʹ਺೔ޙʹJob͕ϦτϥΠ͞ΕΔ͜ͱ΋͋ΓಘΔɻ • ϦτϥΠճ਺ͷ࠷େ஋͸ઃఆͰ͖ͳ͍ɻ

    • Worker#getRunAttemptCount Ͱݱࡏͷࢼߦճ਺Λऔಘ͠ɺFailureͰऴ͑Δɻ • ͦ΋ͦ΋ҙਤ͠ͳ͍ϦτϥΠ͕ߦΘΕͳ͍Α͏ʹΤϥʔϋϯυϦϯά͓ͯ͘͠ࣄ΋ॏཁɻ ࣮૷࣌ͷTIPS΍஫ҙࣄ߲ 5
  4. • https://issuetracker.google.com/issues/122553577 > We never supported Roboelectric. All WorkManager tests

    need to run as an Android 
 > instrumentation test. ςετʹ͍ͭͯ 6