Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the Android Device Emulator have a MAC Address?

I wrote the following code to get the MAC address:

WifiManager wimanager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
String address = wimanager.getConnectionInfo().getMacAddress();
Log.d("TOKEN", address);

This works perfectly on my phone, but in the Android emulator it returns null. Is this because the Android emulator doesn't have a MAC address?

like image 779
ademar111190 Avatar asked May 22 '12 19:05

ademar111190


People also ask

Do emulators have MAC address?

It's the same as when you try getting a hold of the bluetooth stuff on the emulator. There is no MacAdress and should return null.

How do I find my emulator MAC address?

Launch the Terminal Emulator. Just type the following command: ip link set wlan0 address XX:XX:XX:YY:YY:YY, where wlan0 is the name of the interface and XX:XX:XX:YY:YY:YY is the MAC address you want to set.

Do Androids have a MAC address?

Android PhoneOn the Home screen, tap the Menu button and go to Settings. Tap About Phone. Tap Status or Hardware Information (depending on your model of phone). Scroll down to see your WiFi MAC address.

Does Android emulator have device ID?

To find the device ID of a locally connected Android device or emulator, use the adb devices command.


1 Answers

It's the same as when you try getting a hold of the bluetooth stuff on the emulator. There is no MacAdress and should return null. Try on a real device and it will work. The code is correct.

like image 187
Juan Cortés Avatar answered Oct 23 '22 11:10

Juan Cortés