Get the current wifi security used on Android

1.8k views Asked by At

I'm developping an app which may send sensitive data and I want to be sure that i don't send them on a public or weak protected network. That's why I'd like to get the current security used on wifi network on Android.

I found this post but I'm not sure of the accuracy of the solution. Indeed, the allowedKeyManagement method seems to return the supported protocols, but it's not explicitely said to return the current active protocol beeing used. Is there a sure way to get the effective protection used on the cirrent wifi network ?

Thanks

1

There are 1 answers

4
vishalm On

I can suggest one method

  1. Get list of all configured network using getConfiguredNetworks API
  2. Loop through all entries and find the current Network using WifiConfiguration.status API. The status should be CURRENT for current network
  3. For that current network, get the allowedKeyManagement and check that it is not NONE.