package Ġcom . dropbox . k ai ken . sample . advanced sample . app Ċ Ċ import Ġandroid . app . Application Ċ import Ġcom . dropbox . k ai ken . sco ping . App Services Ċ import Ġcom . dropbox . k ai ken . sco ping . Scoped Services Provider Ċ import Ġcom . dropbox . k ai ken . sco ping . User Services Ċ Ċ class ĠAdvanced K ai ken Sample Application Ġ: ĠApplication (), ĠScoped Services Provider Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġapp Services : ĠAdvanced K ai ken Sample App Services ĊĊĠĠĠ Ġ// ĠLet 's Ġuse Ġa Ġmap Ġto Ġm imic Ġour Ġ" User Manager ". ĊĠĠĠ Ġprivate Ġval Ġuser Services Map Ġ= Ġmutable Map Of < String , ĠAdvanced K ai ken Sample User Services >() ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate () ĊĊĠĠĠĠĠĠĠ Ġapp Services Ġ= ĠD agger Advanced K ai ken Sample App Services . factory (). create () ĊĊĠĠĠĠĠĠĠ Ġ// ĠLet 's Ġ" log - in " Ġin Ġa Ġuser Ġfor Ġsample Ġpurposes . ĠIn Ġa Ġreal Ġapplication Ġthis Ġcode Ġwould Ġdefinitely Ġnot Ġlive ĊĠĠĠĠĠĠĠ Ġ// Ġhere Ġand Ġwould Ġbe Ġway Ġway Ġmore Ġcomplex ĊĠĠĠĠĠĠĠ Ġval Ġuser Profile Ġ= ĠUser Profile (" awesome _ user ", Ġ" Awesome ĠUser ") ĊĊĠĠĠĠĠĠĠ Ġuser Services Map [" awesome _ user "] Ġ= ĠD agger Advanced K ai ken Sample User Services . factory (). create ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġapp Services , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġuser Profile ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġprovide App Services (): ĠApp Services Ġ= Ġapp Services ĊĊĠĠĠ Ġoverride Ġfun Ġprovide User Services Of ( userId : ĠString ): ĠUser Services ? Ġ= Ġuser Services Map . get ( userId ) Ċ } Ċ