Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected String doInBackground(String... params) {
- String result = "";
- Integer MAXVALUE = 10000;
- try {
- // Create a URL for the desired page
- URL url = new URL("URL");
- // Read all the text returned by the server
- BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
- char[] resultTab=new char[MAXVALUE];
- int i=0;
- while ((resultTab[i] = (char) in.read()) != -1) {
- i++;
- }
- result = String.copyValueOf(resultTab, 0, i);
- in.close();
- } catch (MalformedURLException e) {
- } catch (IOException e) {
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment