2014年4月2日水曜日

Proxy対応してみた。

import android.net.Proxy;

String hostname = Proxy.getHost(this.mContext);
int port = Proxy.getPort(this.mContext);


// 又は、 String hostname = Settings.Secure.getString( getContentResolver(), Settings.Secure.HTTP_PROXY);

HttpHost proxy = new HttpHost(hostname, port);
httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,proxy);

0 件のコメント:

コメントを投稿

マイコン

 https://sirius506.hatenablog.com/ https://www.facebook.com/toshiharu.ohno https://x.com/sirius506