public String getDataFromURL(String urlStr) throws Exception { URL url = new URL(urlStr); URLConnection urlCon = url.openConnection(); BufferedReader in = new BufferedReader( new InputStreamReader( urlCon.getInputStream())); String data = ""; String line = ""; while ((line = in.readLine()) != null) data += line; in.close(); return data; }
No comments:
Post a Comment