Check network connectivity in API 28> and return the natwork state to the ui
check network connectivity