My Android application uses HttpClient (org.apache.http.client) to
connect to a remote web service.

I want my application to play nicely with HTTP proxies.  I examined
the Android SDK and
found the android.net.Proxy class.

android.net.Proxy allows my application to get the proxy host
(getProxyHost) and proxy port (getProxyPort) . However,
android.net.Proxy does not have any methods for proxy username or
proxy password.

Am I missing something?

Here's what I've coded so far:

        UsernamePasswordCredentials cred = null;

        // todo : what is the Android API for obtaining HTTP proxy
username/password?

        hclient.getCredentialsProvider().setCredentials(
                    new AuthScope(Proxy.getHost(this),
Proxy.getPort(this)),
                    cred);

        HttpHost proxy = new HttpHost(Proxy.getHost(this),
Proxy.getPort(this));

 
hclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,
proxy);

Cheers,

Sean

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to