Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
1.3 kB
3
Indexable
Never
        <provider
            android:name="androidx.startup.InitializationProvider"
            android:authorities="${applicationId}.androidx-startup"
            tools:node="remove">
        </provider>



//    override val workManagerConfiguration: Configuration
//        get() = Configuration.Builder().setMinimumLoggingLevel(Log.DEBUG)
//            .setWorkerFactory(workerFactory).build()



//object NetcoreWorkInitializer {
//    private val constraints =
//        Constraints.Builder().setRequiredNetworkType(NetworkType.CONNECTED).build()
//
//    private val workRequest = PeriodicWorkRequestBuilder<NetcoreWorker>(
//        repeatInterval = 1,
//        repeatIntervalTimeUnit = TimeUnit.DAYS
//    ).setBackoffCriteria(
//        backoffPolicy = BackoffPolicy.LINEAR,
//        duration = Duration.ofMinutes(5)
//    ).setConstraints(constraints).build()
//
//    fun initialize(context: Context) {
//        WorkManager.getInstance(context).apply {
//            // Run work on app startup and ensure only one worker runs at any time
//            enqueueUniquePeriodicWork(
//                NETCORE_WORK_NAME, ExistingPeriodicWorkPolicy.KEEP, workRequest
//            )
//        }
//    }
//}
Leave a Comment