开发者

No internet while running application in android emulator

I get internet access on the browser but when i run the application, the application doesnt get internet. I have used internet permissions. Actually the problem is because of proxy setti开发者_开发技巧ngs. Early there was no internet connectivity on the browser, but later I set the proxy in APN and internet started working on the browser. But the application doesnt get internet. Any solution for this?


** EDITED Apr 13th 2010 ** To get the proxy working with WebView, you apparently need to call WebView.enablePlatformNotifications()

According to the HttpURLConnection docs (Proxies heading):

Proxies

By default, this class will connect directly to the origin server. It can also connect via an HTTP or SOCKS proxy. To use a proxy, use URL.openConnection(Proxy) when creating the connection.

You should be able to enable proxy use by setting the system properties described here, however this may not work on Android - the bug report on Proxy support doesn't go into much detail on where the bug is (e.g. property not set vs property not used)

Proxy use can also be controlled using ProxySelectorRoutePlanner, which is used by AbstractHttpClient.setRoutePlanner. Unfortunately, this means re-writing the httpConnection code to use DefaultHttpClient

Hope this helps,

Phil Lello

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜