Android 4.0 - problems <p>I have 3 problems with android 4.0 (Galaxy tab 10.1). The first one is getting local IP: I use the method:</p> <pre><code>public static String getLocalIpAddress() { try { for (Enumeration&lt;NetworkInterface&gt; en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) { NetworkInterface intf = en.nextElement(); for (Enumeration&lt;InetAddress&gt; enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) { InetAddress inetAddress = enumIpAddr.nextElement(); if (!inetAddress.isLoopbackAddress()) { return inetAddress.getHostAddress().toString(); } } } } catch (SocketException ex) { ex.printStackTrace(); } return null; } </code></pre> <p>It works great on android v2.1-2.3. But some customers who have Android 4.0 complain me that it doesn't work! It returns something like mac-address: fe80::fad0:bdff:fe4d:4871 Can anyone explain what's happened?</p> <p>The second problem is about WiFi checking state. I use function below to check connection to WiFi hotspot point:</p> <pre><code> public boolean IsWiFiConnected(){ List&lt;WifiConfiguration&gt; wifiConfigList = wifiManager.getConfiguredNetworks(); boolean retVal=false; for(WifiConfiguration wifiConf : wifiConfigList){ if(wifiConf.status==WifiConfiguration.Status.CURRENT){ retVal=true; break; } } return retVal; } </code></pre> <p>In android 4.0 it always returns false. </p> <p>And the third problem is getting device's information (it happens on ASUS Transformer Prime): I get information about device by using function below:</p> <pre><code>public static String GetDeviceInfo(Context context){ TelephonyManager telephonyManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE); return Build.BRAND.toString()+"~|~"+Build.DEVICE.toString()+"~|~"+telephonyManager.getDeviceId().toString()+"~|~"+Build.VERSION.RELEASE; } </code></pre> <p>It throws NULLPointerExeption. I think it happens because of TelephonyManager can not be initialized. I have all permissions in manifest. These all functions work fine on the previous versions. </p> <p>Could anyone tell me what's going on? Thank you.</p>