Setting Proxy IP and Port in android code? -


is there way add proxy ip , port in android application internet access routed through proxy?

from link got information

try { settings.system.putstring(getcontentresolver(),
settings.system.http_proxy, "127.0.0.1:100");//enable proxy }catch (exception ex){ }

but trying system variable cannot resolved?

please help!!

thanks in advance

httpurlconnection con =null;  url url = new url("xxxxx");  proxy proxy=new proxy(java.net.proxy.type.http, new inetsocketaddress(android.net.proxy.getdefaulthost(),android.net.proxy.getdefaultport()));  con = (httpurlconnection) url.openconnection(proxy); 

is okay?


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -