List Of Available Wifi Devices
<p>I want to display list of Available Wifi devices. This is my code, I do not understand what mistake is here ?</p>

<pre><code>wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
if (wifi.isWifiEnabled() == false)
   {
Toast.makeText(getApplicationContext(), "wifi is disabled..making it enabled",Toast.LENGTH_LONG).show();
wifi.setWifiEnabled(true);
   }   
String[] str1 = null;
ArrayAdapter&lt;String&gt;adapter=new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1,android.R.id.text1,str1);
 lv.setAdapter(adapter);
 WifiInfo info = wifi.getConnectionInfo();
textStatus.append("\n\nWiFi Status: " + info.toString());
 boolean b=wifi.isWifiEnabled();
if(b){
 wifi.setWifiEnabled(false);
Toast.makeText(getApplicationContext(), "Yes", Toast.LENGTH_SHORT).show();
enter code here
</code></pre>

<hr>

<p>This is my code, i wanna get Wifi enabled device properties specifically in Android by programmatically. How can i get that. can anyone help me here please ?</p>

<pre><code> public void onReceive(Context c, Intent intent) 
        {
 results = wifi.getScanResults();
 size = results.size();
 int i = 0;
 str1 = new String[size];
 for (ScanResult result : results){
 str1[i] = result.SSID + " " + result.level;
 i++;
   }
</code></pre>
