I am working on cab booking app. In all other case I am getting internet status, but I am unable to detect no internet while connected with Bluetooth tethering.
Please any one help me, I'm getting stuck. I need to implement it same like ola and uber app net checking.
I am using below method:
public static boolean isNetworkAvailable(Activity activity) {
NetworkInfo networkInfo = ((ConnectivityManager) activity
.getSystemService(Context.CONNECTIVITY_SERVICE))
.getActiveNetworkInfo();
Log.d("net", "" + networkInfo);
// Log.d("net", ""+!networkInfo.isConnected());
if (networkInfo == null) {
return false;
} else {
if (!networkInfo.isConnected()) {
return false;
}
}
return true;
}