我的应用程序中有这个方法,它告诉我是否有网络连接,但我想知道是否有一种方法可以检查它是一个良好的网络连接。
public static boolean existInternetConnection() {
boolean booThereConnection = false;
if (context == null)
context = activity.getApplicationContext();
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(context.CONNECTIVITY_SERVICE);
NetworkInfo netInfo = cm.getActiveNetworkInfo();
if (netInfo != null && netInfo.isConnectedOrConnecting())
booThereConnection = true;
return booThereConnection;
}