Wulfgang,
More specifically (if I may):
Android maintains an internal list of "known" networks - security
information is kept there. Before connecting to a network, it has to be
entered into this list (and correct security information provided and
stored). Networks on this list are identified by integer ids.
- Get the current Wifi connection: WifiInfo wifiInfo =
wifiManager.getConnectionInfo()
- Get the numeric id of the currently connected network: int networkId =
wifiInfo.getNetworkId()
- Get the list of configured "known" networks:
wifiManager.getConfiguredNetworks()
- Find the currently connected one in this list, matching by networkId.
- This gets you a WifiConfiguration object. Use its fields to determine
its security mode:
http://kmansoft.wordpress.com/2010/04/08/how-to-determine-wifi-networks-security-mode/
Remember that this security setting is not the actual mode being used
with this network at this time, but rather the security setting that
Android expects when connecting to it.
It's probably a good idea to do some tests: e.g. set up a WEP or WPA
protected network, configure it in Android, then switch the router to
lower security mode and see if Android is still able to connect.
-- Kostya
10.09.2010 18:44, Timo пишет:
On Sep 6, 10:35 pm, wulfgang<[email protected]> wrote:
I am writing an application which checks the security protocol of
the phone's wifi connection.
Between the phone and AP, they may use 'wpa', 'wpa2', 'wep' or
unprotected 'open' connections.
Does anyone know how to get such information?
Check out the WifiManager service:
http://developer.android.com/reference/android/net/wifi/WifiManager.html
Cheers,
Timo
--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en