package Ġcom . lj ub env ass ile v . cities . di Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . SharedPreferences Ċ import Ġandroid . preference . Preference Manager Ċ import Ġandroidx . room . Room Ċ import Ġcom . lj ub env ass ile v . cities . db . C ities Db Ċ import Ġdagger . Module Ċ import Ġdagger . Provides Ċ import Ġjavax . inject . Singleton Ċ Ċ @ Module ( includes Ġ= ĠarrayOf ( App Module :: class )) Ċ class ĠData Module Ġ{ ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġpreference ( context : ĠContext ): ĠSharedPreferences Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPreference Manager . getDefault SharedPreferences ( context ) ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġapp Database ( context : ĠContext ): ĠC ities Db Ġ= ĠRoom . database Builder ( context , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠC ities Db :: class . java , ĠC ities Db . DB _ NAME ). build () ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġcity Dao ( cities Db : ĠC ities Db ) Ġ= Ġcities Db . city Dao () Ċ }