get Wifi Scan Result Security - Android Phone

Android examples for Phone:wifi

Description

get Wifi Scan Result Security

Demo Code


//package com.java2s;

import android.net.wifi.ScanResult;

public class Main {
    public static String getScanResultSecurity(ScanResult result) {
        final String capabilities = result.capabilities;
        final String[] securityModes = { "WEP", "PSK", "EAP" };

        for (String securityMode : securityModes) {
            if (capabilities.contains(securityMode)) {
                return securityMode;
            }//from  w  w  w . j  av a2s .c o  m
        }

        return "OPEN";
    }
}

Related Tutorials