I enabled proxy settings in 2.2 and 2.3 version of android in emulator and the internet started working but I have an application installed (which works only with proxy) is still not working. When I did the same for 4.0 version emulator, it was working there. Can anyone tell, why is it not working on 2.2 and 2.3 version though the internet is working.
Share
Configuring your proxy in the emulator allows the Browser application to use it, but any other applications need to be HTTP Proxy capable to access the internet.
Assuming you use the DefaultHttpClient class to connect to the internet, you’ll have to add the following code to your android application before making the connection:
If you are using an authenticated proxy, you’ll need to also have these lines:
Since you want the same code to work on both the emulator as well as a real phone, you should add a setting to the app which allows the user to turn on or off use of the proxy, and enter the proxy server/port/credentials instead of hard-coding them in the application.