-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Description
We run into problems with the setupAndroidProxy() method.
Some providers seem to set a proxy on their 3G or LET networks. Now, if this proxy is set via setupAndroidProxy(), the request can't be sent correctly and we only get a "400 Bad request". Disabling the method works.
What would be needed is a check if the wifi is connected. The problem is, you can't really check for this in setupAndroidProxy, because no context is provided anywhere.
private boolean isWifiConnected()
{
Object o = null;
if (context != null && context.getApplicationContext() != null) {
o = context.getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
}
NetworkInfo wifi = null;
if (o != null && o instanceof ConnectivityManager) {
ConnectivityManager connManager = (ConnectivityManager)o;
wifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
}
return wifi != null && wifi.isConnected();
}
Metadata
Metadata
Assignees
Labels
No labels