Code example for WifiInfo

Methods: getSSIDtoString

0
		Log.d("MMUWiFi", "supplicant state: " + intent.getParcelableExtra("newState").toString());	
		if(intent.getParcelableExtra("newState").toString().equals("COMPLETED")) {
			WifiManager mgr = (WifiManager)(context.getSystemService(Context.WIFI_SERVICE));
			WifiInfo info = mgr.getConnectionInfo();
			if(info!=null) {
				Log.d("MMUWiFi", info.toString());
				if(info.getSSID() != null) {
					Log.d("MMUWiFi", "SSID:" + info.getSSID());
					if(Build.VERSION.SDK_INT >= 17) {
						if(info.getSSID().equals("\"MMU\"")) {					
							Intent i = new Intent(context, SecureWiFiService.class);
							i.putExtra("mode", 0);
							context.startService(i);
						} else { 
							Log.d("MMUWiFi", "Not connected to MMU WiFi");						
						}					 
					} else { 
						if(info.getSSID().equals("MMU")) {					
							Intent i = new Intent(context, SecureWiFiService.class);
							i.putExtra("mode", 0);
							context.startService(i);
						} else { 
							Log.d("MMUWiFi", "Not connected to MMU WiFi");						
Contextual code suggestions in your IDE  Get Codota for Java