package Ġcom . s ano . g ma iled . utils Ċ Ċ import Ġandroid . app . Activity Ċ import Ġandroid . content . Context Ċ import Ġandroid . net . Connectivity Manager Ċ Ċ /** Ċ Ġ* ĠChecks Ġwhether Ġthe Ġdevice Ġcurrently Ġhas Ġa Ġnetwork Ġconnection . Ċ Ġ* Ġ@ return Ġtrue Ġif Ġthe Ġdevice Ġhas Ġa Ġnetwork Ġconnection , Ġfalse Ġotherwise . Ċ Ġ*/ Ċ internal Ġfun Ġis Device Online ( activity : ĠActivity ): ĠBoolean Ġ{ ĊĠĠĠ Ġval Ġconn Mgr Ġ= Ġactivity . getSystem Service ( Context . CONNECT IVITY _ SERVICE ) Ġas ĠConnect ivity Manager ĊĠĠĠ Ġval Ġnetwork Info Ġ= Ġconn Mgr . active Network Info ĊĠĠĠ Ġreturn Ġnetwork Info Ġ!= Ġnull Ġ&& Ġnetwork Info . isConnected Ċ }