Obtain device wifi mac address - Android Wifi

Android examples for Wifi:Wifi Address

Description

Obtain device wifi mac address

Demo Code


//package com.java2s;
import android.content.Context;

import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;

public class Main {
    /**//www . j  a v a2 s  . c  o  m
     * Obtain device wifi mac address
     * 
     * @author Sean Zheng
     * @CreateDate 2013-4-24
     */
    public static String getDeviceUDID(Context context) {
        WifiManager wifi = (WifiManager) context
                .getSystemService(Context.WIFI_SERVICE);
        WifiInfo info = wifi.getConnectionInfo();
        return info.getMacAddress();
    }
}

Related Tutorials