0

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.

Ice
  • 1,783
  • 4
  • 26
  • 52
chohyunwook
  • 203
  • 2
  • 3
  • 14

1 Answers1

0

If you want to get the list of available Wi-Fi connections, you might want to check this one out https://stackoverflow.com/a/18741306/4922967

Check for the results in onReceive.

Community
  • 1
  • 1
BBrain
  • 205
  • 3
  • 7