Code example for WifiInfo

Methods: getBSSID, getHiddenSSID, getSSID

0
		m_activity.registerReceiver(this, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));
		updateCurrentWifi(m_wifiManager.getConnectionInfo());
	} 
	 
	private void updateCurrentWifi(WifiInfo wifiInfo) {
		m_currentBSSID = wifiInfo.getBSSID();
		if (wifiInfo.getHiddenSSID()) {
			m_currentSSID = wifiInfo.getSSID();
		} else { 
			m_currentSSID = null;
		} 
	} 
	 
	public boolean startScanning() { 
		m_scanning = true;
		// Make sure we can actually scan first! 
		if (!m_wifiManager.isWifiEnabled()) {
			Toast.makeText(m_activity, R.string.wifi_enabling, Toast.LENGTH_LONG).show();
			m_wifiManager.setWifiEnabled(true);
		} 
		return m_wifiManager.startScan();