package Ġcom . c ree pers an . switch host . manager Ċ Ċ import Ġandroid . content . Context Ċ import Ġcom . c ree pers an . switch host . application . Switch Host Application Ċ Ċ object ĠConfig Manager { ĊĠĠĠ Ġprivate Ġconst Ġval ĠP REF _ GLOBAL Ġ= Ġ" global " ĊĠĠĠ Ġprivate Ġconst Ġval ĠKEY _ GLOBAL _ HOST _ NAME Ġ= Ġ" host _ name " ĊĊĠĠĠ Ġprivate Ġval Ġm Application Ġ= ĠSwitch Host Application . getInstance () ĊĠĠĠ Ġprivate Ġval Ġm Global Pref Ġby Ġlazy Ġ{ Ġm Application . get SharedPreferences ( PRE F _ GLOBAL , ĠContext . MODE _ PRIVATE ) Ġ} ĊĊĠĠĠ Ġfun ĠgetCurrent HostName (): String { ĊĠĠĠĠĠĠĠ Ġreturn Ġm Global Pref . getString ( KEY _ GLOBAL _ HOST _ NAME , Ġ" ç³»ç»Ł é»ĺè®¤ Host ") Ġ?: Ġ" ç³»ç»Ł é»ĺè®¤ Host " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun ĠsetCurrent HostName ( host Name : String ){ ĊĠĠĠĠĠĠĠ Ġm Global Pref . edit (). putString ( KEY _ GLOBAL _ HOST _ NAME , Ġhost Name ). apply () ĊĠĠĠ Ġ} Ċ Ċ }