Re: [android-developers] Java.net.UnknownHostException using httpGet on Android

2011-06-29 Thread ANKUR GOEL
Just try reloading it sometimes it does not get the host name.

you can use the IP instead of that it will work fine.

Thanks and Regards:-

Ankur Goel



On Fri, Jun 24, 2011 at 7:39 PM, My Email connectmyem...@gmail.com wrote:

 Exception  :

 Java.net.UnknownHostException using httpGet on Android


 String requestTpServer = www.google.com;
 HttpClient client = new DefaultHttpClient();
 HttpResponse response = null ;

 try {

  HttpGet get = new HttpGet(requestToServer);


  response = client.execute(getm);  ///Problem here

 } catch (ClientProtocolException e) {

  e.printStackTrace();
 } catch (IOException e) {

  e.printStackTrace();
 }

 String res = response.toString();

 I have already set  uses-permission
 android:name=android.permission.INTERNET /

 and also run String requestTpServer = www.google.com;  in android
 emulater browser

 thanks

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Java.net.UnknownHostException using httpGet on Android

2011-06-27 Thread My Email
Exception  :

Java.net.UnknownHostException using httpGet on Android


String requestTpServer = www.google.com;
HttpClient client = new DefaultHttpClient();
HttpResponse response = null ;

try {

  HttpGet get = new HttpGet(requestToServer);


  response = client.execute(getm);  ///Problem here

} catch (ClientProtocolException e) {

  e.printStackTrace();
} catch (IOException e) {

  e.printStackTrace();
}

String res = response.toString();

I have already set  uses-permission
android:name=android.permission.INTERNET /

and also run String requestTpServer = www.google.com;  in android
emulater browser

thanks

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en