Get wlan MAC address - Android Network

Android examples for Network:Mac Address

Description

Get wlan MAC address

Demo Code


//package com.java2s;

import android.content.Context;
import android.net.wifi.WifiManager;

public class Main {

    private static String wlanMAC(Context context) {
        String wlanMACStr = "";
        WifiManager wifiManager = (WifiManager) context
                .getSystemService(Context.WIFI_SERVICE);
        wlanMACStr = wifiManager.getConnectionInfo().getMacAddress();
        return wlanMACStr;
    }/*from w  ww. j  a va2  s  . c o m*/
}

Related Tutorials