get Wifi Ap State - Android Phone

Android examples for Phone:wifi

Description

get Wifi Ap State

Demo Code


//package com.java2s;

import android.net.wifi.WifiManager;

public class Main {

    public static boolean getWifiApState(WifiManager wifiManager) {
        try {/*from   w w w  . j  a  v a 2 s. c o m*/
            return ((Boolean) wifiManager.getClass()
                    .getMethod("isWifiApEnabled", new Class[0])
                    .invoke(wifiManager, new Object[0]));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }
}

Related Tutorials