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;

import android.util.Log;

public class Main {
    private static final String TAG = "DeviceUtil";

    /**
     * network tools
     * */
    public static boolean isWifiEnable(Context context) {

        WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);

        Log.i(TAG, "wifiEnable" + wifiManager.isWifiEnabled());
        return wifiManager.isWifiEnabled();
    }
}