package Ġcom . andre aci oc care l li . music downloader . util Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . net . Connectivity Manager Ċ import Ġandroid . net . wifi . Wifi Manager Ċ import Ġcom . andre aci oc care l li . music downloader . App Ċ Ċ /** Ċ Ġ* ĠDesign ed Ġand Ġdeveloped Ġby ĠAnd rea ĠC ioc care l li Ċ Ġ*/ Ċ Ċ enum Ġclass ĠConnection Status Ġ{ ĠON LINE , ĠOFF LINE Ġ} Ċ Ċ object ĠNetwork Util Ġ{ ĊĠĠĠ Ġval Ġconnection Status : ĠConnection Status ĊĠĠĠĠĠĠĠ Ġget () Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġconnection Manager Ġ= ĠApp . context . application Context . getSystem Service ( Context . CONNECT IVITY _ SERVICE ) Ġas ĠConnect ivity Manager ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġwifi State : ĠBoolean Ġ= Ġis Wifi On () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġdata State : ĠBoolean Ġ= Ġis Data On ( connection Manager ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġis Online Ġ= Ġwifi State Ġ|| Ġdata State ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġif Ġ( is Online ) ĠConnection Status . ON LINE Ġelse ĠConnection Status . OFF LINE ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġis Data On ( connections Manager : ĠConnect ivity Manager ): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġconnections Manager . all Networks . map Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( connections Manager . get Network Info ( it ). isConnected ) Ġreturn Ġtrue ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġreturn Ġconnections Manager . get Network Info ( Connectivity Manager . TYPE _ MOB ILE ). isConnected ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġis Wifi On (): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġwifi Ġ= ĠApp . context . application Context . getSystem Service ( Context . WIFI _ SERVICE ) Ġas ĠW ifi Manager ĊĠĠĠĠĠĠĠ Ġreturn Ġwifi . is Wifi Enabled ĊĠĠĠ Ġ} Ċ }