Skip to content

Problem with setupAndroidProxy #289

@pakaufmann

Description

@pakaufmann

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions