Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.content.Context;

import android.net.wifi.WifiManager;

public class Main {
    public static boolean isWifiEnabled(Context mContext) {
        WifiManager wifi_manager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
        if (wifi_manager != null)
            return (WifiManager.WIFI_STATE_ENABLED == wifi_manager.getWifiState())
                    || (WifiManager.WIFI_STATE_ENABLING == wifi_manager.getWifiState());
        return false;
    }
}