package Ġcom . j ur k owski . news app . api Ċ Ċ import Ġandroid . net . Connectivity Manager Ċ import Ġandroid . net . Network Capabilities Ċ import Ġandroid . os . Build Ċ Ċ class ĠNetwork Status Checker ( private Ġval Ġconnectivity Manager : ĠConnect ivity Manager ?) Ġ{ ĊĊĠ Ġfun Ġhas Internet Connection (): ĠBoolean Ġ{ ĊĠĠĠ Ġval Ġnetwork Ġ= Ġconnectivity Manager ?. active Network Ġ?: Ġreturn Ġfalse ĊĠĠĠ Ġval Ġcapabilities Ġ= Ġconnectivity Manager . get Network Capabilities ( network ) Ġ?: Ġreturn Ġfalse ĊĠĠĠ Ġreturn Ġwhen Ġ{ ĊĠĠĠĠĠ Ġcapabilities . has Transport ( Network Capabilities . TRANSPORT _ WIFI ) Ġ-> Ġtrue ĊĠĠĠĠĠ Ġcapabilities . has Transport ( Network Capabilities . TRANSPORT _ CELL ULAR ) Ġ-> Ġtrue ĊĠĠĠĠĠ Ġcapabilities . has Transport ( Network Capabilities . TRANSPORT _ VPN ) Ġ-> Ġtrue ĊĠĠĠĠĠ Ġelse Ġ-> Ġfalse ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ }