network detection refactoring, current implementatin not supported by android webview