package Ġcom . oct ac ores oft wares . k ud if x Ċ Ċ import Ġandroid . app . Application Ċ import Ġandroidx . work .* Ċ import Ġcom . oct ac ores oft wares . k ud if x . di . App Component Ċ import Ġcom . oct ac ores oft wares . k ud if x . di . D agger App Component Ċ import Ġcom . oct ac ores oft wares . k ud if x . di . Work ManagerFactory Ċ import Ġcom . oct ac ores oft wares . k ud if x . services . Latest Rates Worker Ċ import Ġdagger . android . Android Injector Ċ import Ġdagger . android . Dispatch ing Android Injector Ċ import Ġdagger . android . Has Android Injector Ċ import Ġjava . util . concurrent . TimeUnit Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠApp : ĠApplication (), ĠHas Android Injector , ĠConfiguration . Provider Ġ{ ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġlateinit Ġvar Ġandroid Injector : ĠDispatch ing Android Injector < Any > ĊĊĠĠĠ Ġlateinit Ġvar Ġapp Component : ĠApp Component ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate () Ġ{ ĊĠĠĠĠĠĠĠ Ġapp Component Ġ= ĠD agger App Component . factory (). create ( this ) ĊĠĠĠĠĠĠĠ Ġapp Component . inject ( this ) ĊĠĠĠĠĠĠĠ Ġsuper . onCreate () ĊĊĠĠĠĠĠĠĠ Ġval Ġconstraint Ġ= ĠConstraints . Builder () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Required Network Type ( Network Type . CONNECTED ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠĠĠ ĠWork Manager . getInstance ( this ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. enqueue Unique Periodic Work (" k ud if x ", ĠExisting Periodic Work Policy . REPLACE , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠPeriod ic Work RequestBuilder < Latest Rates Worker >( 3 0 , ĠTimeUnit . MIN UTES ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Constraints ( constraint ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġandroid Injector (): ĠAndroid Injector < Any > Ġ= Ġandroid Injector ĊĊĠĠĠ Ġoverride Ġfun Ġget Work Manager Configuration (): ĠConfiguration Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfactory Ġ= Ġapp Component . work Factory () ĊĠĠĠĠĠĠĠ Ġreturn ĠConfiguration . Builder (). set Worker Factory ( factory ). build () ĊĠĠĠ Ġ} Ċ }