我想調用一個BroadcastReceiver
對一個開放的WiFi
網絡發現,那麼Action
的名字應該是IntentFilter
?在一個開放的WiFi網絡上發現廣播接收器
<receiver android:name=".MyWiFiReceiver" >
<intent-filter>
<action android:name="?????????????" />
</intent-filter>
</receiver>
我想調用一個BroadcastReceiver
對一個開放的WiFi
網絡發現,那麼Action
的名字應該是IntentFilter
?在一個開放的WiFi網絡上發現廣播接收器
<receiver android:name=".MyWiFiReceiver" >
<intent-filter>
<action android:name="?????????????" />
</intent-filter>
</receiver>
試試這個。 我用來檢查連接性變化。
<receiver android:name=".service.NetworkChangeReceiver">
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<category android:name="com.example.quangtv" />
</intent-filter>
</receiver>
我不認爲有這樣的行爲,將過濾的網絡類型。 這就是說,你可以在更改掃描網絡,並檢查他們的開放的使用方法,例如:
static int getSecurity(ScanResult result) {
if (result.capabilities.contains("WEP")) {
return SECURITY_WEP;
} else if (result.capabilities.contains("PSK")) {
return SECURITY_PSK;
} else if (result.capabilities.contains("EAP")) {
return SECURITY_EAP;
}
return SECURITY_NONE;
}
我想這個答案可能會幫助你(上面的方法是從那裏獲取): android: Determine security type of wifi networks in range (without connecting to them)
但是udi,當設備發現一個開放的wifi時,我會從內置的WiFi應用程序獲得一個簡單的通知。所以我認爲有一些具體的行動對應於事件。不管怎麼說謝謝你的答案:) – theapache64
那麼,你可以通過這種方式來檢查網絡,你已經通過android.net.conn.CONNECTIVITY_CHANGE –
我今天上大學了,以後再檢查一下,謝謝你的回答。 – theapache64