I am trying to find a reliable way to tell if an Android device is wifi-only. I tried a couple of ways:
-- Try to get device ID (IMEI/MEID), if I can not get the IMEI/MEID number, then I can assume the device is wifi-only. This doesn't work as some phones do not return a device ID when they are put in flight mode. -- Try to read TelephonyManager.getPhoneType. This doesn't work either as the wifi-only device I am testing with returns PHONE_TYPE_GSM, while I expect it to return PHONE_TYPE_NONE.
I wonder if anyone has successfully distinguish wifi-only devices and the non-wifi-only ones.
On Android phones: Go to Settings. Tap Connections. Then, tap Data Usage.
To check the cellular and power status On the home screen, tap Apps > Settings. Find and tap About Device > Status.
Wi-Fi powered smart phones can access the Internet via Fon hot spots. Generally speaking, connecting a smart phone to an 802.11b or 802.11g Wi-Fi router smart phone works in exactly the same way as from a laptop. If the router accepts authenticated connections only, use the smart phone's Internet browser to log in.
You could query the system features in your app to see if that works.
PackageManager pm = getPackageManager();
boolean isAPhone = pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY);
If you care about GSM/CDMA use the more specific FEATURE_TELEPHONY_GSM
or FEATURE_TELEPHONY_CDMA
.
If the device is lying there is of course not much you can do afaik.
Following solution worked for me better:
TelephonyManager mgr = (TelephonyManager)ctx.getSystemService( Context.TELEPHONY_SERVICE );
return mgr.getPhoneType() != TelephonyManager.PHONE_TYPE_NONE;
And following did NOT work on few devices like Nook Tablet:
PackageManager pm = ctx.getPackageManager();
return pm.hasSystemFeature( PackageManager.FEATURE_TELEPHONY );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With