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DVUJPO ˖ خ؎٦زך鷏⥋ ˖ ؚٗ鷏⥋ ˖ ر٦ةず劍 ˖ ًر؍،ؿ؋؎ٕך؟٦غ٦פך،حفٗ٦س ⳿ⰩIUUQTZPVUVCF*S,P#'-X5/ ⳿ⰩIUUQTZPVUVCFQ&S5Z2Q"

Slide 10

Slide 10 text

˖ غحؙؚٓؐٝسדװ׷ץֹֿהכ׋ֻׁ׿֮׷ ˖ ؚٗ鷏⥋ծ،حفٗ٦سծر٦ةず劍ծر٦ة׾Ⳣ椚ׅ׷ ˖ ׋ֻׁ׿غحؙؚٓؐٝسד㹋遤ׅ׷倯岀ָ֮׷ ˖ 5ISFBE &YFDVUPS 4FSWJDF "TZOD5BTLזו ⦐ּ׵ְ֮ ׷ ˖ "OESPJEךغحذٔ٦剑黝⻉ך堣腉׮׋ֻׁ׿֮׷ ˖ %P[FNPEF "QQTUBOECZ -JNJUFEJNQMJDJUCSPBEDBTUT 3FMFBTFDBDIFEXBLFMPDLT 1ד涪邌ׁ׸׋׮ך׾ろ׭׷ הծ֮ה⦐ּ׵ְ֮׷ %FGFSSBCMFHVBSBOUFFEFYFDVUJPO ך⡦ָ㉏겗ַ

Slide 11

Slide 11 text

˖ ة؎ىָؚٝ䖓חז׏ג׮״ֻծ⹛⡲ׅ׷ֿהָ⥂鏾׃׋ְ㜥 さ׋ֻׁ׿ך鍑寸倯岀ָ֮׷կ ˖ +PC4DIFEVMFS 'JSFCBTF+PC%JTQBUDIFS "MBSN.BOBHFS #SPBEDBTU3FDFJWFST ˖ ⟃♴ך״ֲז鍑寸ٗآحؙ׾荈ⴓד剅ְגծ׋ֻׁ׿ךֿה׾ 罋䣁׃זָ׵׋ֻׁ׿ך"1*ךㄎן⳿׃׾剅ֻ䗳銲ָ֮׷կ %FGFSSBCMFHVBSBOUFFEFYFDVUJPO ך⡦ָ㉏겗ַ

Slide 12

Slide 12 text

˖ ة؎ىָؚٝ䖓חז׏ג׮״ֻծ⹛⡲ׅ׷ֿהָ⥂鏾׃׋ְ㜥 さ׋ֻׁ׿ך鍑寸倯岀ָ֮׷կ ˖ +PC4DIFEVMFS 'JSFCBTF+PC%JTQBUDIFS "MBSN.BOBHFS #SPBEDBTU3FDFJWFST ˖ ⟃♴ך״ֲז鍑寸ٗآحؙ׾荈ⴓד剅ְגծ׋ֻׁ׿ךֿה׾ 罋䣁׃זָ׵׋ֻׁ׿ך"1*ךㄎן⳿׃׾剅ֻ䗳銲ָ֮׷կ %FGFSSBCMFHVBSBOUFFEFYFDVUJPO ך⡦ָ㉏겗ַ ֿ׸ח8PSL.BOBHFSָ㼎䘔ׅ׷

Slide 13

Slide 13 text

ו׿זةأؙח8PSL.BOBHFS׾
 ⢪ֲץַֹ ˖ ءأذيָ،فٔ׾穄✪׃׋ה׃ג׮ծ⹛⡲⥂鏾׃׋ְةأؙ ך׋׭ח⢪ֲկ ˖ ،فٔךفٗإأָ穄✪׃ג׮ծ㸜Ⰻח穄✪דֹ׷ةأؙך׋ ׭חכⵃ欽׃זְկ׉׸כ5ISFBE1PPMַ 3Y+BWBַDPSPVUJOF ׾אֲַץֹ ⳿ⰩIUUQTEFWFMPQFSBOESPJEDPNUPQJDMJCSBSJFTBSDIJUFDUVSFXPSLNBOBHFS

Slide 14

Slide 14 text

⢽ִלו׿זةأؙ ˖ ӧخ؎٦ز ˖ ӧًر؍،ؿ؋؎ٕך؟٦غ٦פך،حفٗ٦س ˖ ӧر٦ةךػ٦أהر٦ةك٦أפך⥂㶷 ˖ –ػٖحزؕٓ٦׾䬄⳿׃ג*NBHF7JFX׾،حف ر٦ز ˖ –ر٦ة׾ػ٦أ׃ג7JFXך،حفر٦ز ˖ –铬ꆃךزٓٝؠؙءّٝ׾㹋遤 ⳿ⰩIUUQTZPVUVCF*S,P#'-X5/

Slide 15

Slide 15 text

⢽ִלו׿זةأؙ ˖ ӧخ؎٦ز ˖ ӧًر؍،ؿ؋؎ٕך؟٦غ٦פך،حفٗ٦س ˖ ӧر٦ةךػ٦أהر٦ةك٦أפך⥂㶷 ˖ –ػٖحزؕٓ٦׾䬄⳿׃ג*NBHF7JFX׾،حف ر٦ز ˖ –ر٦ة׾ػ٦أ׃ג7JFXך،حفر٦ز ˖ –铬ꆃךزٓٝؠؙءّٝ׾㹋遤 ⳿ⰩIUUQTZPVUVCF*S,P#'-X5/ ^ ˖ 5ISFBE1PPM ˖ 3Y+BWB ˖ ,PUMJO $PSPVUJOF
 ׾⢪ֲ

Slide 16

Slide 16 text

⢽ִלו׿זةأؙ ˖ ӧخ؎٦ز ˖ ӧًر؍،ؿ؋؎ٕך؟٦غ٦פך،حفٗ٦س ˖ ӧر٦ةךػ٦أהر٦ةك٦أפך⥂㶷 ˖ –ػٖحزؕٓ٦׾䬄⳿׃ג*NBHF7JFX׾،حف ر٦ز ˖ –ر٦ة׾ػ٦أ׃ג7JFXך،حفر٦ز ˖ –铬ꆃךزٓٝؠؙءّٝ׾㹋遤 ⳿ⰩIUUQTZPVUVCF*S,P#'-X5/ ^ ˖ 5ISFBE1PPM ˖ 3Y+BWB ˖ ,PUMJO $PSPVUJOF
 ׾⢪ֲ ˖ 'PSFHSPVOE 4FSWJDF׾⢪ֲ

Slide 17

Slide 17 text

8PSL.BOBHFSך⢪ְ倯

Slide 18

Slide 18 text

8PSL.BOBHFSך㼪Ⰵ implementation “android.arch.work:work-runtime:1.0.0-alpha01” ̔䗳갭 implementation "android.arch.work:work-firebase:1.0.0-alpha01" ̔'JSFCBTF+PC%JTQBUDIFS׾⢪ֲ㜥さ䗳銲 implementation “android.arch.work:work-runtime-ktx:1.0.0-alpha01" ̔,PUMJO׾⢪ֲ㜥さծ֮׏׋קֲָ知患ח剅ֽ׷ androidTestImplementation “android.arch.work:work-testing:1.0.0-alpha01" ̔ذأز׾剅ֽ׷

Slide 19

Slide 19 text

8PSL.BOBHFSך⚥䗰הז׷ؙٓأ

Slide 20

Slide 20 text

8PSL.BOBHFSך⚥䗰הז׷ؙٓأ ˖ 8PSL⡲噟׾ׅ׷ؙٓأկ㹋ꥷחװ׶׋ְֿה׾竰䪫׃ג鎸鶢ׅ ׷

Slide 21

Slide 21 text

8PSL.BOBHFSך⚥䗰הז׷ؙٓأ ˖ 8PSL⡲噟׾ׅ׷ؙٓأկ㹋ꥷחװ׶׋ְֿה׾竰䪫׃ג鎸鶢ׅ ׷ ˖ 8PSL3FRVFTU8PSLךؙٔؒأزךؙٓأկ

Slide 22

Slide 22 text

8PSL.BOBHFSך⚥䗰הז׷ؙٓأ ˖ 8PSL⡲噟׾ׅ׷ؙٓأկ㹋ꥷחװ׶׋ְֿה׾竰䪫׃ג鎸鶢ׅ ׷ ˖ 8PSL3FRVFTU8PSLךؙٔؒأزךؙٓأկ ˖ 0OF5JNF8PSL3FRVFTU♧䏝ֹ׶ך8PSLך㹋遤ך㜥さך 3FRVFTU

Slide 23

Slide 23 text

8PSL.BOBHFSך⚥䗰הז׷ؙٓأ ˖ 8PSL⡲噟׾ׅ׷ؙٓأկ㹋ꥷחװ׶׋ְֿה׾竰䪫׃ג鎸鶢ׅ ׷ ˖ 8PSL3FRVFTU8PSLךؙٔؒأزךؙٓأկ ˖ 0OF5JNF8PSL3FRVFTU♧䏝ֹ׶ך8PSLך㹋遤ך㜥さך 3FRVFTU ˖ 1FSJPEJD8PSL3FRVFTU粸׶鵤׃8PSLך㹋遤ׅ׷㜥さך 3FRVFTU

Slide 24

Slide 24 text

8PSLFS׾⢪׏ג׫׷ "EE)FMMP 8PSLFS ˑ8PSME˒̔ JOQVU PVUQVU ˑ)FMMP 8PSME˒ ̔

Slide 25

Slide 25 text

8PSLFS׾⢪׏ג׫׷ const val KEY = "key" class AddHelloWorker : Worker() { override fun doWork(): WorkerResult { val inputString = inputData.getString(KEY, "") val outputString = "Hello, $inputString" outputData = mapOf(KEY to outputString).toWorkData() return WorkerResult.SUCCESS } }

Slide 26

Slide 26 text

const val KEY = "key" class AddHelloWorker : Worker() { override fun doWork(): WorkerResult { val inputString = inputData.getString(KEY, "") val outputString = "Hello, $inputString" outputData = mapOf(KEY to outputString).toWorkData() return WorkerResult.SUCCESS } } 8PSLFS׾竰䪫׃ג㹋鄲

Slide 27

Slide 27 text

const val KEY = "key" class AddHelloWorker : Worker() { override fun doWork(): WorkerResult { val inputString = inputData.getString(KEY, "") val outputString = "Hello, $inputString" outputData = mapOf(KEY to outputString).toWorkData() return WorkerResult.SUCCESS } } EP8PSL ׾㹋鄲׃ג 㹋ꥷחֿך8PSLד װ׷ֿה׾剅ֻ

Slide 28

Slide 28 text

const val KEY = "key" class AddHelloWorker : Worker() { override fun doWork(): WorkerResult { val inputString = inputData.getString(KEY, "") val outputString = "Hello, $inputString" outputData = mapOf(KEY to outputString).toWorkData() return WorkerResult.SUCCESS } } EP8PSL ך⚥כ CBDLHSPVOEUISFBEד㹋遤ׁ׸׷

Slide 29

Slide 29 text

const val KEY = "key" class AddHelloWorker : Worker() { override fun doWork(): WorkerResult { val inputString = inputData.getString(KEY, "") val outputString = "Hello, $inputString" outputData = mapOf(KEY to outputString).toWorkData() return WorkerResult.SUCCESS } } 䗳銲ח䘔ׄג䒷侧הז׷JOQVU%BUB׾《׸׷ JOQVU%BUBכBOESPJEYXPSL%BUBؙٓأ 䖓鶢

Slide 30

Slide 30 text

const val KEY = "key" class AddHelloWorker : Worker() { override fun doWork(): WorkerResult { val inputString = inputData.getString(KEY, "") val outputString = "Hello, $inputString" outputData = mapOf(KEY to outputString).toWorkData() return WorkerResult.SUCCESS } } XPSLSVOUJNFLUYךUP8PSL%BUB ד BOESPJEYXPSL%BUBؙٓأח㢌䳔

Slide 31

Slide 31 text

const val KEY = "key" class AddHelloWorker : Worker() { override fun doWork(): WorkerResult { val inputString = inputData.getString(KEY, "") val outputString = "Hello, $inputString" outputData = mapOf(KEY to outputString).toWorkData() return WorkerResult.SUCCESS } } PVUQVU%BUBח➿Ⰵׅ׷

Slide 32

Slide 32 text

const val KEY = "key" class AddHelloWorker : Worker() { override fun doWork(): WorkerResult { val inputString = inputData.getString(KEY, "") val outputString = "Hello, $inputString" outputData = mapOf(KEY to outputString).toWorkData() return WorkerResult.SUCCESS } } 8PSL3FTVMU׾鵤ׅ 46$$&44 '"*-63& 3&53: 3&53:׾鵤ׇל׮ֲ♧䏝㹋遤דֹ׷

Slide 33

Slide 33 text

˖ ,#׃ַ⥂盖דֹזְךדر٦ةأز،ה׃ג䪔׏גכז׵ זְ *MMFHBM4UBUF&YDFQUJPO׾䫎־׷ ˖ ,FZָ4USJOH ˖ 7BMVFָفٔىذ؍ـ㘗ַ4USJOHծ׉ךꂁ⴨ BOESPJEYXPSL%BUBؙٓأהכ

Slide 34

Slide 34 text

8PSLFS׾⢪׏ג׫׷ val workRequest = OneTimeWorkRequestBuilder() .setInputData(mapOf(KEY to "World").toWorkData()) .build() WorkManager.getInstance().enqueue(workRequest) // workΛ؂ࢹ WorkManager.getInstance() .getStatusById(workRequest.id) .observe(this, Observer { workStatus -> workStatus ?: return@Observer when (workStatus.state) { State.SUCCEEDED -> { val outputData: Data = workStatus.outputData val output = outputData.getString(KEY, "default") toast(output) } else -> { } }

Slide 35

Slide 35 text

val workRequest = OneTimeWorkRequestBuilder() .setInputData(mapOf(KEY to "World").toWorkData()) .build() WorkManager.getInstance().enqueue(workRequest) // workΛ؂ࢹ WorkManager.getInstance() .getStatusById(workRequest.id) .observe(this, Observer { workStatus -> workStatus ?: return@Observer when (workStatus.state) { State.SUCCEEDED -> { val outputData: Data = workStatus.outputData val output = outputData.getString(KEY, "default") toast(output) } else -> { } } 8PSL3FRVFTU׾⡲䧭

Slide 36

Slide 36 text

val workRequest = OneTimeWorkRequestBuilder() .setInputData(mapOf(KEY to "World").toWorkData()) .build() WorkManager.getInstance().enqueue(workRequest) // workΛ؂ࢹ WorkManager.getInstance() .getStatusById(workRequest.id) .observe(this, Observer { workStatus -> workStatus ?: return@Observer when (workStatus.state) { State.SUCCEEDED -> { val outputData: Data = workStatus.outputData val output = outputData.getString(KEY, "default") toast(output) } else -> { } TFU*OQVU%BUBדر٦ة׾床ׅ

Slide 37

Slide 37 text

val workRequest = OneTimeWorkRequestBuilder() .setInputData(mapOf(KEY to "World").toWorkData()) .build() WorkManager.getInstance().enqueue(workRequest) // workΛ؂ࢹ WorkManager.getInstance() .getStatusById(workRequest.id) .observe(this, Observer { workStatus -> workStatus ?: return@Observer when (workStatus.state) { State.SUCCEEDED -> { val outputData: Data = workStatus.outputData val output = outputData.getString(KEY, "default") toast(output) } else -> { } FORVFVF ד㹋遤

Slide 38

Slide 38 text

val workRequest = OneTimeWorkRequestBuilder() .setInputData(mapOf(KEY to "World").toWorkData()) .build() WorkManager.getInstance().enqueue(workRequest) // workΛ؂ࢹ WorkManager.getInstance() .getStatusById(workRequest.id) .observe(this, Observer { workStatus -> workStatus ?: return@Observer when (workStatus.state) { State.SUCCEEDED -> { val outputData: Data = workStatus.outputData val output = outputData.getString(KEY, "default") toast(output) } else -> { } 8PSL.BOBHFSHFU4UBUVT#Z*Eד -JWF%BUB8PSL4UBUVTָ《䖤דֹ׷

Slide 39

Slide 39 text

val workRequest = OneTimeWorkRequestBuilder() .setInputData(mapOf(KEY to "World").toWorkData()) .build() WorkManager.getInstance().enqueue(workRequest) // workΛ؂ࢹ WorkManager.getInstance() .getStatusById(workRequest.id) .observe(this, Observer { workStatus -> workStatus ?: return@Observer when (workStatus.state) { State.SUCCEEDED -> { val outputData: Data = workStatus.outputData val output = outputData.getString(KEY, "default") toast(output) } else -> { } } JEכ8PSL3FRVFTUַ׵《䖤דֹ׷կ

Slide 40

Slide 40 text

val workRequest = OneTimeWorkRequestBuilder() .setInputData(mapOf(KEY to "World").toWorkData()) .build() WorkManager.getInstance().enqueue(workRequest) // workΛ؂ࢹ WorkManager.getInstance() .getStatusById(workRequest.id) .observe(this, Observer { workStatus -> workStatus ?: return@Observer when (workStatus.state) { State.SUCCEEDED -> { val outputData: Data = workStatus.outputData val output = outputData.getString(KEY, "default") toast(output) } else -> { } } }) 8PSL4UBUVT4UBUFד朐䡾׾鋅׷ #-0$,&% $"/$&--&% &/26&6&% '"*-&% 36//*/( 46$$&&%&%ָ֮׷

Slide 41

Slide 41 text

val workRequest = OneTimeWorkRequestBuilder() .setInputData(mapOf(KEY to "World").toWorkData()) .build() WorkManager.getInstance().enqueue(workRequest) // workΛ؂ࢹ WorkManager.getInstance() .getStatusById(workRequest.id) .observe(this, Observer { workStatus -> workStatus ?: return@Observer when (workStatus.state) { State.SUCCEEDED -> { val outputData: Data = workStatus.outputData val output = outputData.getString(KEY, "default") toast(output) } else -> { } } }) XPSL4UBUVTַ׵PVUQVU׃׋%BUBؙٓأח ،ؙإأדֹ׷

Slide 42

Slide 42 text

8PSL.BOBHFSך堣腉稱➜

Slide 43

Slide 43 text

8PSL.BOBHFSך堣腉稱➜ ˖ 8PSLך⣛㶷ؚٓؿָ⡲׸׷ ˖ UIFO ד8PSL׾籬־׵׸׷ ˖ 3Y+BWBך[JQ׫׋ְזֿהָדֹ׷ ˖ *OQVU.FSHFS׾⢪ֲ ˖ 8PSLח勴⟝׾אֽ׵׸׷ ˖ -JWF%BUBד➙ך朐䡾ָ鋅׵׸׷ ˖ 8PSLחةؚ׾אֽג穾׶鴥׫זוָדֹ׷ ˖ ثؑ؎ٝꟚ㨣儗חِص٦ؙזせ⵸׾אֽג穾׶鴥׫װծ
 ずׄせ⵸ָ崧׸׋הֹךⵖ䖴ָדֹ׷

Slide 44

Slide 44 text

UIFO ד8PSL׾籬־׵׸׷ ˖ ⱖ溪ךؿ؍ٕة٦׾ַֽ׋䖓،حفٗ٦س׃׋ְהֹזוחⵃ欽ׅ׷ ˖ ➙㔐כ8PSME)FMMP 8PSME)&--0 803-%׾װ׏ג׫׋ WorkManager.getInstance() .beginWith( OneTimeWorkRequestBuilder() .setInputData( mapOf( KEY to "World" ).toWorkData() ) .build() ) .then(OneTimeWorkRequestBuilder().build()) .enqueue()

Slide 45

Slide 45 text

8PSL.BOBHFSך堣腉稱➜ ˖ 8PSLך⣛㶷ؚٓؿָ⡲׸׷ ˖ UIFO ד8PSL׾籬־׵׸׷ ˖ 3Y+BWBך[JQ׫׋ְזֿהָדֹ׷ ˖ *OQVU.FSHFS׾⢪ֲ ˖ 8PSLח勴⟝׾אֽ׵׸׷ ˖ -JWF%BUBד➙ך朐䡾ָ鋅׵׸׷ ˖ 8PSLחةؚ׾אֽג穾׶鴥׫זוָדֹ׷ ˖ ثؑ؎ٝꟚ㨣儗חِص٦ؙזせ⵸׾אֽג穾׶鴥׫װծ
 ずׄせ⵸ָ崧׸׋הֹךⵖ䖴ָדֹ׷

Slide 46

Slide 46 text

8PSLח勴⟝׾אֽ׵׸׷ val workRequest = OneTimeWorkRequestBuilder() .setInputData(mapOf(KEY to "World").toWorkData()) .setConstraints(Constraints.Builder().setRequiresCharging(true).build()) .build() TFU$POTUSBJOUד鏣㹀׃ג֮־׷ ⯍ꨵָ㨣ת׷הծ㹋遤ׁ׸׷ ˖ طحزٙ٦ؙחאזָ׏גְ׷儗ך׫ծ
 ⯍ꨵ儗ך׫㹋遤זוך♳ꣲָאֽ׵׸׷

Slide 47

Slide 47 text

8PSL.BOBHFSך堣腉稱➜ ˖ 8PSLך⣛㶷ؚٓؿָ⡲׸׷ ˖ UIFO ד8PSL׾籬־׵׸׷ ˖ 3Y+BWBך[JQ׫׋ְזֿהָדֹ׷ ˖ *OQVU.FSHFS׾⢪ֲ ˖ 8PSLח勴⟝׾אֽ׵׸׷ ˖ -JWF%BUBד➙ך朐䡾ָ鋅׵׸׷ ˖ 8PSLחةؚ׾אֽג穾׶鴥׫זוָדֹ׷ ˖ ثؑ؎ٝꟚ㨣儗חِص٦ؙזせ⵸׾אֽג穾׶鴥׫װծ
 ずׄせ⵸ָ崧׸׋הֹךⵖ䖴ָדֹ׷

Slide 48

Slide 48 text

8PSLחةؚ׾אֽג穾׶鴥׫זו ָדֹ׷ val taggedRequest = OneTimeWorkRequestBuilder() .setInputData(mapOf(KEY to "WorkManager").toWorkData()) .addTag("tag") .build() WorkManager.getInstance().enqueue(taggedRequest) WorkManager.getInstance() .getStatusesByTag("tag") .observe(this, Observer> { workStatuses -> val workStatus = workStatuses?.getOrNull(0) ?: return@Observer when (workStatus.state) { State.SUCCEEDED -> { BEE5BHדةؚ鷄⸇ ˖ 㥨ֹחط٦يأل٦أ׾⡲׸׷

Slide 49

Slide 49 text

8PSLחةؚ׾אֽג穾׶鴥׫זו ָדֹ׷ val taggedRequest = OneTimeWorkRequestBuilder() .setInputData(mapOf(KEY to "WorkManager").toWorkData()) .addTag("tag") .build() WorkManager.getInstance().enqueue(taggedRequest) WorkManager.getInstance() .getStatusesByTag("tag") .observe(this, Observer> { workStatuses -> val workStatus = workStatuses?.getOrNull(0) ?: return@Observer when (workStatus.state) { State.SUCCEEDED -> { HFU4UBUVTFT#Z5BHד穾׶鴥׫ ˖ ➭ח׮ةؚ⽃⡘דٍؗٝإٕ׃׋׶⳿勻׷

Slide 50

Slide 50 text

8PSL.BOBHFSך堣腉稱➜ ˖ 8PSLך⣛㶷ؚٓؿָ⡲׸׷ ˖ UIFO ד8PSL׾籬־׵׸׷ ˖ 3Y+BWBך[JQ׫׋ְזֿהָדֹ׷ ˖ *OQVU.FSHFS׾⢪ֲ ˖ 8PSLח勴⟝׾אֽ׵׸׷ ˖ -JWF%BUBד➙ך朐䡾ָ鋅׵׸׷ ˖ 8PSLחةؚ׾אֽג穾׶鴥׫זוָדֹ׷ ˖ ثؑ؎ٝꟚ㨣儗חِص٦ؙזせ⵸׾אֽג穾׶鴥׫װծ
 ずׄせ⵸ָ崧׸׋הֹךⵖ䖴ָדֹ׷

Slide 51

Slide 51 text

ثؑ؎ٝꟚ㨣儗חِص٦ؙזせ⵸׾אֽג 穾׶鴥׫װծⵖ䖴ָדֹ׷ val workRequest = OneTimeWorkRequestBuilder() .setInputData(mapOf(KEY to "World").toWorkData()) .build() WorkManager.getInstance() .beginUniqueWork("hello", ExistingWorkPolicy.KEEP, workRequest ).enqueue() CFHJO6OJRVF8PSL׾⢪ֲ

Slide 52

Slide 52 text

ثؑ؎ٝꟚ㨣儗חِص٦ؙזせ⵸׾אֽג 穾׶鴥׫װծⵖ䖴ָדֹ׷ val workRequest = OneTimeWorkRequestBuilder() .setInputData(mapOf(KEY to "World").toWorkData()) .build() WorkManager.getInstance() .beginUniqueWork("hello", ExistingWorkPolicy.KEEP, workRequest ).enqueue() ずׄせ⵸ד8PSL׾㨣׭׋儗ךهٔء٦ ˖ ,&&1⯓ח㨣׭׋8PSL׌ֽ㹋遤 ˖ 3&1-"$&⯓ח㨣׭׋8PSL׾ٍؗٝإٕ׃ג⵴ꤐծ倜׃ְ8PSL׾Ꟛ㨣 ˖ "11&/%⯓ח㨣׭׋8PSLך䖓חծ⚕倯遤ֲկ

Slide 53

Slide 53 text

*OTJEF8PSL.BOBHFS

Slide 54

Slide 54 text

8PSL.BOBHFSךⰻ鿇㹋鄲ך㛇劤 ΍ת׆&YFDVUPSד㹋遤 %#ח䞔㜠׾Ⰵ׸גַ׵ծ΍ת׆&YFDVUPSד㹋遤ׅ׷կ
 ׉ך꟦חفٗإأָ姺ת׏ג׮葺ְ״ֲח Ύ+PC4DIFEVMFSזוַ׵&YFDVUPS׾㹋遤ׅ׷ Ύⴻ㹀׃גծ׉׸׊׸ך 倯岀ד㹋遤 ⳿ⰩIUUQTZPVUVCF*S,P#'-X5/

Slide 55

Slide 55 text

8PSL.BOBHFSךⰻ鿇㹋鄲ך㛇劤 ΍ת׆&YFDVUPSד㹋遤 %#ח䞔㜠׾Ⰵ׸גַ׵ծ΍ת׆&YFDVUPSד㹋遤ׅ׷կ
 ׉ך꟦חفٗإأָ姺ת׏ג׮葺ְ״ֲח Ύ+PC4DIFEVMFSזוַ׵&YFDVUPS׾㹋遤ׅ׷ Ύⴻ㹀׃גծ׉׸׊׸ך 倯岀ד㹋遤 ⳿ⰩIUUQTZPVUVCF*S,P#'-X5/ %#42-JUF

Slide 56

Slide 56 text

8PSL.BOBHFSך⣛㶷ꟼ⤘ BOESPJEBSDIXPSLXPSLSVOUJNFBMQIB ]BOESPJEBSDIMJGFDZDMFFYUFO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آحؙ public @NonNull List getSchedulers() { // Initialized at construction time. So no need to synchronize. if (mSchedulers == null) { mSchedulers = Arrays.asList( Schedulers.createBestAvailableBackgroundScheduler(mContext), new GreedyScheduler(mContext, this)); } return mSchedulers; } ˖ (SFFEZ4DIFEVMFSה DSFBUF#FTU"WBJMBCMF#BDLHSPVOE4DIFEVMFS׾⢪ֲ ˖ (SFFEZ4DIFEVMFS ˖ DSFBUF#FTU"WBJMBCMF#BDLHSPVOE4DIFEVMFS ˖ ⡦ד㹋遤ׅ׷ַ鼅䫛ׅ׷ًاحس

Slide 60

Slide 60 text

&YFDVUPSװ+PC4DIFEVMFSזוך
 鼅䫛ٗآحؙ public @NonNull List getSchedulers() { // Initialized at construction time. So no need to synchronize. if (mSchedulers == null) { mSchedulers = Arrays.asList( Schedulers.createBestAvailableBackgroundScheduler(mContext), new GreedyScheduler(mContext, this)); } return mSchedulers; } ˖ (SFFEZ4DIFEVMFSה DSFBUF#FTU"WBJMBCMF#BDLHSPVOE4DIFEVMFS ׾⢪ֲ ˖ (SFFEZ4DIFEVMFS ˖ DSFBUF#FTU"WBJMBCMF#BDLHSPVOE4DIFEVMFS ˖ ⡦ד㹋遤ׅ׷ַ鼅䫛ׅ׷ًاحس

Slide 61

Slide 61 text

8PSL.BOBHFSךⰻ鿇㹋鄲 5ISFBE1PPMח״׷㹋鄲 ˖ 5ISFBE1PPMַ׵兛鸐ח㹋遤ׅ׷崧׸կ

Slide 62

Slide 62 text

8PSL.BOBHFSךⰻ鿇㹋鄲 5ISFBE1PPMח״׷㹋鄲 ず儗חאTDIFEVMFׅ׷ (SFFEZ4DIFEVMFSה
 ֿך畭劣דכ 4ZTUFN+PC4DIFEVMFS׾ⵃ欽ׅ׷

Slide 63

Slide 63 text

8PSL.BOBHFSךⰻ鿇㹋鄲 5ISFBE1PPMח״׷㹋鄲 (SFFEZ4DIFEVMFSַ׵
 5ISFBE1PPM׾穗ג XPSLFSEP8PSL ָ㹋遤ׁ׸׷

Slide 64

Slide 64 text

8PSL.BOBHFSךⰻ鿇㹋鄲ך㛇劤 ΍ת׆&YFDVUPSד㹋遤 %#ח䞔㜠׾Ⰵ׸גַ׵ծ΍ת׆&YFDVUPSד㹋遤ׅ׷կ
 ׉ך꟦חفٗإأָ姺ת׏ג׮葺ְ״ֲח Ύ+PC4DIFEVMFSזוַ׵&YFDVUPS׾㹋遤ׅ׷ Ύⴻ㹀׃גծ׉׸׊׸ ך倯岀ד㹋遤 ⳿ⰩIUUQTZPVUVCF*S,P#'-X5/

Slide 65

Slide 65 text

&YFDVUPSװ+PC4DIFEVMFSזוך
 鼅䫛ٗآحؙ public @NonNull List getSchedulers() { // Initialized at construction time. So no need to synchronize. if (mSchedulers == null) { mSchedulers = Arrays.asList( Schedulers.createBestAvailableBackgroundScheduler(mContext), new GreedyScheduler(mContext, this)); } return mSchedulers; } ˖ (SFFEZ4DIFEVMFSה DSFBUF#FTU"WBJMBCMF#BDLHSPVOE4DIFEVMFS׾⢪ֲ ˖ (SFFEZ4DIFEVMFS ˖ DSFBUF#FTU"WBJMBCMF#BDLHSPVOE4DIFEVMFS

Slide 66

Slide 66 text

&YFDVUPSװ+PC4DIFEVMFSזוך
 鼅䫛ٗآحؙ public @NonNull List getSchedulers() { // Initialized at construction time. So no need to synchronize. if (mSchedulers == null) { mSchedulers = Arrays.asList( Schedulers.createBestAvailableBackgroundScheduler(mContext), new GreedyScheduler(mContext, this)); } return mSchedulers; } ˖ (SFFEZ4DIFEVMFSה DSFBUF#FTU"WBJMBCMF#BDLHSPVOE4DIFEVMFS׾⢪ֲ ˖ (SFFEZ4DIFEVMFS ˖ DSFBUF#FTU"WBJMBCMF#BDLHSPVOE4DIFEVMFS

Slide 67

Slide 67 text

DSFBUF#FTU"WBJMBCMF#BDLHSPVOE
 4DIFEVMFS static @NonNull Scheduler createBestAvailableBackgroundScheduler(@NonNull Context context) { Scheduler scheduler; boolean enableFirebaseJobService = false; boolean enableSystemAlarmService = false; if (Build.VERSION.SDK_INT >= WorkManagerImpl.MIN_JOB_SCHEDULER_API_LEVEL) { scheduler = new SystemJobScheduler(context); setComponentEnabled(context, SystemJobService.class, true); Log.d(TAG, "Created SystemJobScheduler and enabled SystemJobService"); } else { try { scheduler = tryCreateFirebaseJobScheduler(context); enableFirebaseJobService = true;

Slide 68

Slide 68 text

static @NonNull Scheduler createBestAvailableBackgroundScheduler(@NonNull Context context) { Scheduler scheduler; boolean enableFirebaseJobService = false; boolean enableSystemAlarmService = false; if (Build.VERSION.SDK_INT >= WorkManagerImpl.MIN_JOB_SCHEDULER_API_LEVEL) { scheduler = new SystemJobScheduler(context); setComponentEnabled(context, SystemJobService.class, true); Log.d(TAG, "Created SystemJobScheduler and enabled SystemJobService"); } else { try { scheduler = tryCreateFirebaseJobScheduler(context); enableFirebaseJobService = true; Log.d(TAG, "Created FirebaseJobScheduler"); } catch (Exception e) { // Also catches the exception thrown if Play Services was not found on the device. scheduler = new SystemAlarmScheduler(context); "1*-FWFM⟃♳ד֮׸לծ 4ZTUFN+PC4DIFEVMFS׾⢪ֲ

Slide 69

Slide 69 text

boolean enableSystemAlarmService = false; if (Build.VERSION.SDK_INT >= WorkManagerImpl.MIN_JOB_SCHEDULER_API_LEVEL) { scheduler = new SystemJobScheduler(context); setComponentEnabled(context, SystemJobService.class, true); Log.d(TAG, "Created SystemJobScheduler and enabled SystemJobService"); } else { try { scheduler = tryCreateFirebaseJobScheduler(context); enableFirebaseJobService = true; Log.d(TAG, "Created FirebaseJobScheduler"); } catch (Exception e) { // Also catches the exception thrown if Play Services was not found on the device. scheduler = new SystemAlarmScheduler(context); enableSystemAlarmService = true; Log.d(TAG, "Created SystemAlarmScheduler"); } } "1*-FWFM劢弫ד֮׸לծ 'JSFCBTF+PC4DIFEVMFS׾ 鑐ׅ

Slide 70

Slide 70 text

Log.d(TAG, "Created SystemJobScheduler and enabled SystemJobService"); } else { try { scheduler = tryCreateFirebaseJobScheduler(context); enableFirebaseJobService = true; Log.d(TAG, "Created FirebaseJobScheduler"); } catch (Exception e) { // Also catches the exception thrown if Play Services was not found on the device. scheduler = new SystemAlarmScheduler(context); enableSystemAlarmService = true; Log.d(TAG, "Created SystemAlarmScheduler"); } } ׉׸ד׮تًד֮׸ל "MBSN.BOBHFS׾⢪ֲ

Slide 71

Slide 71 text

DSFBUF#FTU"WBJMBCMF#BDLHSPVOE
 4DIFEVMFS static @NonNull Scheduler createBestAvailableBackgroundScheduler(@NonNull Context context) { Scheduler scheduler; boolean enableFirebaseJobService = false; boolean enableSystemAlarmService = false; if (Build.VERSION.SDK_INT >= WorkManagerImpl.MIN_JOB_SCHEDULER_API_LEVEL) { scheduler = new SystemJobScheduler(context); setComponentEnabled(context, SystemJobService.class, true); Log.d(TAG, "Created SystemJobScheduler and enabled SystemJobService"); } else { try { scheduler = tryCreateFirebaseJobScheduler(context); enableFirebaseJobService = true; DSFBUF#FTU"WBJMBCMF#BDLHSPVOE
 4DIFEVMFS דכせ⵸ך鸐׶ ⢪ִ׷♧殢ְְ4DIFEVMFS׾鵤ׅ

Slide 72

Slide 72 text

8PSL.BOBHFSךⰻ鿇㹋鄲 +PC4DIFEVMFSח״׷㹋鄲 ˖ +PC4DIFEVMFSח״׶㹋遤ׅ׷崧׸կ

Slide 73

Slide 73 text

8PSL.BOBHFSךⰻ鿇㹋鄲 +PC4DIFEVMFSח״׷㹋鄲 4ZTUFN+PC4DIFEVMFSח״׶4ZTUFN+PC4FSWJDFָ ㄎן⳿ׁ׸׷

Slide 74

Slide 74 text

8PSL.BOBHFSךⰻ鿇㹋鄲 +PC4DIFEVMFSח״׷㹋鄲 ׉ַֿ׵8PSL.BOBHFS*NQMTUBSU8PSLָㄎן⳿ׁ׸׷

Slide 75

Slide 75 text

8PSL.BOBHFSךⰻ鿇㹋鄲 饯⹛Ⳣ椚 ˖ .FSHFE.BOJGFTU׾然钠׃ג׫ת׃׋կ ˖ $POUFOU1SPWJEFSד،فָٔ饯⹛ׅ׷ة؎ىؚٝד荈⹛דⴱ劍⻉կ
 'JSFCBTFָずׄ倯岀דⴱ劍⻉׃ג鑧겗חז׶ת׃׋կ ˖ IUUQTSFCBTFHPPHMFCMPHDPNUBLFDPOUSPMPGZPVSSFCBTFJOJUPOIUNM ˖ #005@$0.1-&5&%ד畭劣ך饯⹛ד׮׍ׯ׿ה⹛ְגֻ׸תׅկ

Slide 76

Slide 76 text

8PSL.BOBHFSךذأز

Slide 77

Slide 77 text

8PSL.BOBHFSךذأز @Test fun test() { val testDriver = WorkManagerTestInitHelper.getTestDriver() val workRequest = OneTimeWorkRequestBuilder() .setInputData(mapOf(KEY to "World").toWorkData()) .build() WorkManager.getInstance() .enqueue(workRequest) testDriver.setAllConstraintsMet(workRequest.id) val outputData = WorkManager.getInstance().synchronous().getStatusByIdSync(workRequest.id).out putData assertThat(outputData.getString(KEY, "none"), equalTo("Hello, World")) } 5FTU%SJWFS ׾⢪׏גず劍涸ח⹛ַ׃גذأزדֹ׷

Slide 78

Slide 78 text

8PSL.BOBHFSך؟ٝفٕ 㹋鄲

Slide 79

Slide 79 text

8PSL.BOBHFSך؟ٝفٕ㹋鄲 ˖ HPPHMFTBNQMFT BOESPJEBSDIJUFDUVSF DPNQPOFOUTח֮׷ ˖ IUUQTHJUIVCDPN HPPHMFTBNQMFT BOESPJEBSDIJUFDUVSF DPNQPOFOUT ˖ /BWJHBUJPOזו׮ֿֿח ֮׷ךד鋅ג׫׷ה葺ְ ה䙼ְתׅկ

Slide 80

Slide 80 text

8PSL.BOBHFSך؟ٝفٕ㹋鄲

Slide 81

Slide 81 text

كأزفؙٓذ؍أ

Slide 82

Slide 82 text

كأزفؙٓذ؍أ ˖ ءأذيָ،فָٔ穄✪׃׋ה׃ג׮ծ⹛⡲⥂鏾׃׋ְ ةأؙך׋׭ח⢪ֲկ ˖ %BUBؙٓأכر٦ةأز،דכזְךד3PPNזו׾⢪ֲ ˖ 㹋遤דֹ׷堣⠓׾ֲֲַָ״ֲח$POTUSBJOUד勴⟝׾剅ֿ ֲկ
 ⢽ִל歗⫷ך⸇䊨ה،حفٗ٦س׾ׅ׷儗ח،حفٗ٦ سך8PSLחطحزٙ٦ָؙ䗳銲׌ה׃גֶֽלծ
 굲遤堣ח⛦׏גְ׷꟦ח歗⫷ך⸇䊨תדכ穄׻׏גծ籬 ָ׏׋׵،حفٗ٦س׃גֻ׸׷זוָדֹ׷ ⳿ⰩIUUQTZPVUVCF*S,P#'-X5/

Slide 83

Slide 83 text

תה׭ ˖ ءأذيָ،فָٔ穄✪׃׋ה׃ג׮ծ⹛⡲⥂鏾׃׋ְةأؙ ך׋׭ח⢪ֲկ ˖ 04ך⣛㶷ծ⢪ֲץֹ➬穈׫ךⴖ׶剏ִזוծהג׮嚂חז׷կ ن؎ٓ٦فٖ٦زָזׇֻ׷կ ˖ 8PSLחⵖ秈׾אֽ׸׷ծ籬־׵׸׷ծةָؚאֽ׵׸׷ծせ ⵸ָאֽ׵׸׷ծ朐䡾׾-JWF%BUBד《䖤דֹ׷կ ˖ ⢪ְ׫׍כ㢳ְךדծ⢪׏ג׫׷ה葺ׁ׉ֲկ

Slide 84

Slide 84 text

⿫罋项俱 ˖ IUUQTEFWFMPQFSBOESPJEDPNUPQJDMJCSBSJFTBSDIJUFDUVSF XPSLNBOBHFS ˖ IUUQTXXXZPVUVCFDPNXBUDI W*S,P#'-X5/ ˖ IUUQTXXXZPVUVCFDPNXBUDI WQ&S5Z2Q" ˖ IUUQTDPEFMBCTEFWFMPQFSTHPPHMFDPNDPEFMBCTBOESPJE XPSLNBOBHFS ˖ IUUQTHJUIVCDPNHPPHMFTBNQMFTBOESPJEBSDIJUFDUVSF DPNQPOFOUTUSFFNBTUFS8PSL.BOBHFS4BNQMF