Hi iam using sdk 1.6,my browser works fine nd iam able to connect to all sites fromit.Iam behind proxy.
Iam not able to connect to gmail through my code,when i do it,i get host unresolved error.
I surfed regarding this error and found it to be something common,but none of the sites and blogs gave a solution to this problem.
I have given internet permissions in manifest file too.
The application basically tries to login to gmail with proper authentication and is supposed to fetch google contacts to emulator.
But iam not able to proceed further as i get this error please help me out!!
Any valuable suggestion welcome.
Thanks in advance
You get UnResolvedHost error because the client cannot connect to the remote machine. When you are sitting behind a proxy, you should set the proxy IP and port number in the class doing the transport. I have used DefaultHttpClient class for all of my GET and POST requests. This is how I set proxy(see if you can do something similar):
Setting the proxy in your APN settings will help you use your emulator Browser; I think, you will have to find a way to set proxy from your code.
BTW, the code snippet I posted, is for making proxy settings in the DefaultHttpClient class.
I notice you are using a custom class for doing the transport: import com.example.socapp.HTTPRequestHelper; You can try and find a way to make proxy settings in your HTTPRequestHelper class. Without knowing what this class is, I cant say much.
I generally use DefaultHttpClient class that comes with default android.jar to do my transport and the code snippet I posted in my reply above, configures the proxy for me.
Alternatives: 1. you can try to turn off the proxy and try your code
2. If you try your code on the actual device instead of emulator, and if the problem in your code is with the proxy settings alone, you can be assured that your code will work.