Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.List;

import android.content.Context;

import android.net.wifi.ScanResult;

import android.net.wifi.WifiManager;
import android.telephony.NeighboringCellInfo;
import android.telephony.TelephonyManager;

public class Main {
    public static void getScanWifiResults(Context context) {
        WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
        List<ScanResult> wifiResults = wifiManager.getScanResults();
        for (ScanResult wifi : wifiResults) {
            //         LogUtil.log(TAG, Log.DEBUG, wifi.toString());
        }

        TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);

        //      LogUtil.log(TAG, Log.DEBUG, TelephonyManager.PHONE_TYPE_GSM + "----" + tm.getPhoneType());
        List<NeighboringCellInfo> cellResults = tm.getNeighboringCellInfo();
        for (NeighboringCellInfo cell : cellResults) {
            //         LogUtil.log(TAG, Log.DEBUG, cell.getCid() + "-" + cell.getLac() + "-" + cell.getRssi() + "-" + cell.getPsc()
            //               + "-" + cell.getNetworkType());
        }

        //      LogUtil.log(TAG, Log.DEBUG, getProviderName(context).getText());
    }
}