Skip to main content
deleted 48 characters in body
Source Link
Andriy Kuba
  • 8.3k
  • 2
  • 31
  • 46

You can use http://jsoup.org library or

URL url = new URL("http://www.android.com/"); HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); try {  InputStream in = new BufferedInputStream(urlConnection.getInputStream());  readStream(in);  }finally {   urlConnection.disconnect();  } 

and covert Input Stream to String

BufferedReader br = new BufferedReader( new InputStreamReader(is));

 StringBuilder sb = new StringBuilder(); String line; while ((line = br.readLine()) != null) { sb.append(line); } System.out.println(sb.toString()); br.close(); 
BufferedReader br = new BufferedReader(new InputStreamReader(is)); StringBuilder sb = new StringBuilder(); String line; while ((line = br.readLine()) != null) { sb.append(line); } System.out.println(sb.toString()); br.close(); 

You can use http://jsoup.org library or

URL url = new URL("http://www.android.com/"); HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); try { InputStream in = new BufferedInputStream(urlConnection.getInputStream()); readStream(in); finally {   urlConnection.disconnect();  } 

and covert Input Stream to String

BufferedReader br = new BufferedReader( new InputStreamReader(is));

 StringBuilder sb = new StringBuilder(); String line; while ((line = br.readLine()) != null) { sb.append(line); } System.out.println(sb.toString()); br.close(); 

You can use http://jsoup.org library or

URL url = new URL("http://www.android.com/"); HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); try {  InputStream in = new BufferedInputStream(urlConnection.getInputStream());  readStream(in);  }finally { urlConnection.disconnect(); } 

and covert Input Stream to String

BufferedReader br = new BufferedReader(new InputStreamReader(is)); StringBuilder sb = new StringBuilder(); String line; while ((line = br.readLine()) != null) { sb.append(line); } System.out.println(sb.toString()); br.close(); 
Source Link
hami
  • 11
  • 1

You can use http://jsoup.org library or

URL url = new URL("http://www.android.com/"); HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); try { InputStream in = new BufferedInputStream(urlConnection.getInputStream()); readStream(in); finally { urlConnection.disconnect(); } 

and covert Input Stream to String

BufferedReader br = new BufferedReader( new InputStreamReader(is));

 StringBuilder sb = new StringBuilder(); String line; while ((line = br.readLine()) != null) { sb.append(line); } System.out.println(sb.toString()); br.close();