Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.ArrayList;
import java.util.List;
import android.content.Context;

import android.net.wifi.WifiConfiguration;

import android.net.wifi.WifiManager;

public class Main {
    public static List<WifiConfiguration> getHotspotsList(Context context) {
        final WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
        if (wifiManager == null)
            return new ArrayList<WifiConfiguration>();
        return wifiManager.getConfiguredNetworks();
    }
}