package Ġcom . example . android . polit ical prepared ness . utils Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . net . Connectivity Manager Ċ import Ġandroid . net . Network Capabilities Ċ import Ġjava . text . SimpleDateFormat Ċ import Ġjava . util .* Ċ Ċ fun ĠDate . to Simple String (): ĠString Ġ{ ĊĠĠĠ Ġval Ġformat Ġ= ĠSimpleDateFormat (" EEE Ġdd ĠM MM Ġy yyy ", ĠLocale . US ) ĊĠĠĠ Ġreturn Ġformat . format ( this ) Ċ } Ċ Ċ fun Ġis Network Available ( context : ĠContext ): ĠBoolean Ġ{ ĊĠĠĠ Ġval Ġconnectivity Manager Ġ= Ġcontext . getSystem Service ( Context . CONNECT IVITY _ SERVICE ) Ġas ĠConnect ivity Manager ĊĠĠĠ Ġval Ġnetwork Ġ= Ġconnectivity Manager . active Network Ġ?: Ġreturn Ġfalse ĊĠĠĠ Ġval Ġactive Network Ġ= Ġconnectivity Manager . get Network Capabilities ( network ) Ġ?: Ġreturn Ġfalse ĊĠĠĠ Ġreturn Ġwhen Ġ{ ĊĠĠĠĠĠĠĠ Ġactive Network . has Transport ( Network Capabilities . TRANSPORT _ WIFI ) Ġ-> Ġtrue ĊĠĠĠĠĠĠĠ Ġactive Network . has Transport ( Network Capabilities . TRANSPORT _ CELL ULAR ) Ġ-> Ġtrue ĊĠĠĠĠĠĠĠ Ġactive Network . has Transport ( Network Capabilities . TRANSPORT _ ETHER NET ) Ġ-> Ġtrue ĊĠĠĠĠĠĠĠ Ġactive Network . has Transport ( Network Capabilities . TRANSPORT _ BL U ETO OTH ) Ġ-> Ġtrue ĊĠĠĠĠĠĠĠ Ġelse Ġ-> Ġfalse ĊĠĠĠ Ġ} Ċ }