I'm trying to get MAC addres of Wifi network of Eclipse android emulator with this:
WifiManager wifiManager = (WifiManager) LoginActivity.this.getSystemService(WIFI_SERVICE);
            WifiInfo wInfo = wifiManager.getConnectionInfo();
            String macAddress = wInfo.getMacAddress(); 
            System.out.println("HI");
            System.out.println(macAddress);
This is the android manifest permissions
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
When the execution arrives to
System.out.println(macAddress);
The app crashes with java nullpointerexception and close it.
What are doing wrong? I have to add wifi conectivity to emulator?
 
    