i want browse website proxy have (with apps want make of course). want change programmatically (without go settings or other 3rd apps included).
here i've done :
public class webviewactivity extends activity { webview web; string proxy_ip = "myproxy"; int proxy_port = myport; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.web_view); web = (webview) findviewbyid(r.id.webview1); web.setwebviewclient(new mywebclient()); web.getsettings().setjavascriptenabled(true); web.loadurl("myurl"); if (proxy_ip != null) { defaulthttpclient httpclient = new defaulthttpclient(); httpclient.getcredentialsprovider().getcredentials(new authscope(proxy_ip, proxy_port)); new usernamepasswordcredentials("username","passsword"); httphost proxy = new httphost(proxy_ip, proxy_port); } }
i use webview this. tried using phonegap , editing asset. i'm confused php code. decided using webview instead.
the problem how make webview using proxy.
note: i'm using gb 2.3
have tried android proxy library ? https://github.com/shouldit/android-proxy-library
it's maybe solution
Comments
Post a Comment