Hello, This code does what I want and works just fine as long as there is "service" or an "internet connection".
*********** code ********************** public static String getHTTPresult(String URLwithGet){ Log.d("MP103", TAG + "--------start getHTTPresult--------------------------------"); String strTemp = "this is a XX test"; HttpClient httpclient = new DefaultHttpClient(); HttpGet httpget = new HttpGet(URLwithGet); Log.d("MP103", TAG + "executing request " + httpget.getURI()); ResponseHandler<String> responseHandler = new BasicResponseHandler(); String responseBody = ""; Log.d("MP103", TAG + "just before try "); try { responseBody = httpclient.execute(httpget, responseHandler); } catch (ClientProtocolException e) { e.printStackTrace(); Log.d("MP103", TAG + "error in getHTTPresult, ClientProtocolException = " + e.toString()); } catch (IOException e) { Log.d("MP103", TAG + "error in getHTTPresult, IOException = " + e.toString()); e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); Log.d("MP103", TAG + "error in getHTTPresult, Exception = " + e.toString()); Log.d("MP103", e.toString()); } Log.d("MP103", TAG + "after try catch "); if (responseBody == "") { Log.d("MP103", TAG + "responseBody = ''"); responseBody = "http error, responseBody = ''"; } else { Log.d("MP103", TAG + "responseBody !== ''"); //Log.d("MP103", TAG + responseBody); } Log.d("MP103", TAG + "--------end getHTTPresult--------------------------------"); httpclient.getConnectionManager().shutdown(); return responseBody; } ******************* end code **************************** My beta tester had trouble when he was out of service. His description was "it froze up". When I test on the emulator, I unplug the network cable, and thus have no connection. On the emulator, in the routine listed above, it seems to work just fine although it takes a while before returning "UnknownHost". I say it works just fine because of what I can see in the Log results. It does however display the error "Application MyApp (in process mnt.android.myapp.MA103) is not responding." along with a Force Close button and a Wait button. If I wait a moment and press the Wait button, the app proceeds like it should. What can I do to avoid the long wait (and error) when there is no service? Thanks, John Brown -- 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