This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
allprojects { | |
repositories { | |
google() | |
jcenter() | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val constraints = Constraints.Builder() | |
.setRequiresCharging(true) | |
.setRequiresStorageNotLow(true) | |
.setRequiredNetworkType(NetworkType.CONNECTED) | |
.build() | |
val syncOnlyOnce = OneTimeWorkRequestBuilder<SyncDataWorker>() | |
.setConstraints(constraints) | |
.build() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val userIdData = Data.Builder() | |
.putInt(DATA_USER_ID, userId) | |
.build() | |
val syncOnlyOnce = OneTimeWorkRequestBuilder<SyncWorker>() | |
.setInputData(userIdData) | |
.build() | |
val userIdInput = inputData.getInt(Constants.DATA_USER_ID, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val syncOnlyOnce = OneTimeWorkRequestBuilder<SyncWorker>() | |
.setInputData(userIdData) | |
.addTag(Constants.WORKER_SYNC) | |
.addTag(Constants.ONE_SYNC) | |
.build() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WorkManager.getInstance() | |
.beginUniqueWork(Constants.UNIQUE_NAME, ExistingWorkPolicy.REPLACE, task1) | |
.then(task2) | |
.then(task3) | |
.enqueue() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WorkManager.getInstance() | |
.beginUniqueWork(Constants.UNIQUE_NAME, ExistingWorkPolicy.REPLACE, task1) | |
.then(task2) | |
.then(task3) | |
.enqueue() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WorkManager.getInstance() | |
.beginUniqueWork(Constants.UNIQUE_NAME, ExistingWorkPolicy.REPLACE, task1) | |
.then(task2) | |
.then(task3) | |
.enqueue() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WorkManager.getInstance() | |
.beginUniqueWork(Constants.UNIQUE_NAME, ExistingWorkPolicy.REPLACE, task1) | |
.then(task2) | |
.then(task3) | |
.enqueue() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WorkManager.getInstance() | |
.beginUniqueWork(Constants.UNIQUE_NAME, ExistingWorkPolicy.REPLACE, task1) | |
.then(task2) | |
.then(task3) | |
.enqueue() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WorkManager.getInstance() | |
.beginUniqueWork(Constants.UNIQUE_NAME, ExistingWorkPolicy.REPLACE, task1) | |
.then(task2) | |
.then(task3) | |
.enqueue() |