Your code snippet works fine. Could you post your Manifest file where you include the Internet permission?
Furthermore I noticed the exception when you have no data connectivity. Make sure that you have data connectivity! -- Roman Baumgaertner Sr. SW Engineer-OSDC ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Jun 17, 1:53 am, chen hence <[email protected]> wrote: > url="http://www.google.com/ig/api?weather=beijing" > log shows unknown host www.google.comthrow unknow > > 2009/6/16 Marco Nelissen <[email protected]> > > > what does it say in the log? > > > On Tue, Jun 16, 2009 at 1:57 AM, [email protected] < > > [email protected]> wrote: > > >> here is my code: > >> it always interrupt at conn.connect(); > >> try { > >> url+=input.getText().toString(); > >> myFileUrl = new URL(url); > >> } > >> catch (MalformedURLException e) { > >> e.printStackTrace(); > >> } > >> try { > >> HttpURLConnection conn = (HttpURLConnection) myFileUrl > >> .openConnection(); > >> conn.setDoInput(true); > >> conn.connect(); > >> InputStream is = conn.getInputStream(); > >> val=inputStreamToString(is); > >> is.close(); > >> } > >> catch (IOException e) { > >> e.printStackTrace(); > >> } > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

