I have an Android Application that works on a single phone. In order to work in a single device I need to get MAC address or Android ID. So I decided to get MAC address because the app need to connect on a specified WiFi network. So how to get the MAC address from an Android Device.
WifiManager manager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
WifiInfo info = manager.getConnectionInfo();
String address = info.getMacAddress();
currently I'm using this but it is not stable, but when app restarts it crashes.
It return 02:00:00:00:00:00. and app crashes