1

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 settings. 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?

2
  • How is your app connecting to the internet? Raw sockets, WebView, AndroidHttpConnection, something else? Commented Apr 6, 2011 at 21:37
  • httpConnection and webview both. The application fetches RSS feeds from the server. Commented Apr 7, 2011 at 5:33

1 Answer 1

1

** 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

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for the help, but its not working. It works at my home but it doesnt work at my work place since it is under proxy. I need a way around the proxy.
Are you saying that if you call WebView.enablePlatformNotifications, the WebView still doesn't use the proxy defined with the APN? I'll update my answer for further suggestions on the httpConnection.
Okay the webview is working now. But I am still not getting the xml feeds from the internet. The application further uses facbook and twitter apis. No internet over there aswell. Error i get is Host is unresolved
I've done a final edit on my answer, I can't easily set up a proxy for testing in my environment, so need to bow out now. Hope you get this resolved.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.