기술참고자료/Android | 2011. 5. 6. 13:35
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
WifiManager wm = (WifiManager)getSystemService(Context.WIFI_SERVICE);
WifiInfo wi = wm.getConnectionInfo();
Log.d("WIFI", "BSSID : " + wi.getBSSID());
Log.d("WIFI", "Hidden SSID : " + wi.getHiddenSSID());
Log.d("WIFI", "IP : " + wi.getIpAddress());
Log.d("WIFI", "LinkSpeed : " + wi.getLinkSpeed());
Log.d("WIFI", "MAC Addr. : " + wi.getMacAddress());
Log.d("WIFI", "Net ID : " + wi.getNetworkId());
Log.d("WIFI", "RSSI : " + wi.getRssi());
Log.d("WIFI", "SSID : " + wi.getSSID());
Log.d("WIFI", "Supplicant State : " + wi.getSupplicantState());
Log.d("WIFI", "Detailed State : " + WifiInfo.getDetailedStateOf(wi.getSupplicantState()));
Log.d("WIFI", "String : " + wi.toString());
Log.d("WIFI", "Ping Result : " + wm.pingSupplicant());
// Wifi가 연결되었는지 상태 체크
DetailedState ni_ds = WifiInfo.getDetailedStateOf(wi.getSupplicantState());
if ((wi.getIpAddress()!= 0)
&& (ni_ds == DetailedState.CONNECTED || ni_ds == DetailedState.OBTAINING_IPADDR)){
// Wifi AP에 연결된 상태
}
[Android] BroadcastReceiver 샘플테스트 (0) | 2011.05.06 |
---|---|
[Android] Parcelable을 이용해 액티비티간 인텐트로 객체넘기기 (1) | 2011.05.06 |
[Android] BroadcastReceiver에서 wifi / 3G 분기하기 (0) | 2011.05.06 |
진저브레드관련 - Android App 개발시 주의사항요청(CTS 승인이슈건) (0) | 2011.05.06 |
[안드로이드] Disable scroll view action (0) | 2011.05.04 |
Recent Comments