WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
Method[] wmMethods = wifi.getClass().getDeclaredMethods();
for(Method method: wmMethods){
if(method.getName().equals("isWifiApEnabled")) {
try {
method.invoke(wifi);
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
I understand it's not in time, but it may help others.
вторник, 7 декабря 2010 г., 3:19:43 UTC+2 пользователь edrowland написал:
>
> I'd like to be able to distinguish between Mobile non-Access-Point,
> and Mobile with-Access-Point mode, but I can't seem to figure out how
> to do it.
>
> When a 2.2 phone is configured as a Mobile Access Point, WifiManager
> says that the wifi is disconnected. ConnectionManager says pretty much
> the same: that the connection is mobile rather than wifi. The only
> distinction I seem to be able to make is that the IP address when
> acting as an Access Point is "192.168.*", rather than "10.*.*.*".
> That doesn't seem like an entirely safe way to do things.
>
> The application: I really don't want to send SSDP broadcast packets
> onto a 3G network. I can't imagine it would actually work. But if it
> did, the results would be truly catastrophic. So I'd just plain rather
> not.
>
> I'd like a safe way to distinguish the two case: Mobile/no-
> AccessPoint, and Mobile/with access point.
>
> Anyone?
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en