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 isWiFiActive(Context inContext) {
        WifiManager wm = null;
        try {
            wm = (WifiManager) inContext.getSystemService(Context.WIFI_SERVICE);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (wm == null || wm.isWifiEnabled() == false)
            return false;
        return true;
    }
}