I want How to Check if my device has connectable Wi-Fi List available.
this my source
private boolean isOnline() {
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netInfo = cm.getActiveNetworkInfo();
if (netInfo != null && netInfo.isConnectedOrConnecting()) {
//current network not null, wifi/ethernet connected or connecting
return true;
} else {
//network null, not uses network.
return false;
}
}
but, this source 1 problem.
To use WI-FI my device, connected wireless LAN card.
When the current network is not connected (not wifi, not ethernet)
return false.
but I want if my device has connectable Wi-Fi list available, return true.
and return false my device no Wi-Fi list available.
How to check if my device has connectable Wi-Fi list available on android?
thanks.