title: how to download website content (text) to String in Android Studio
body: <p>I'm new in Android developing, and have start first real app which need to download content from website and convert it to a String (can be source code or something, i will cut what I need). I've searched stackoverflow and whole internet for 3 days but my low skills don't give me working app, always was some errors, missing class etc., 
  this links dont hepl me: 
  <a href="https://stackoverflow.com/questions/14418021/get-text-from-web-page-to-string">Get text from web page to string</a>
  <a href="https://stackoverflow.com/questions/16994777/android-get-html-from-web-page-as-string-with-httpclient-not-working">Android: get HTML from web page as String with HttpClient not working</a>
  <a href="https://stackoverflow.com/questions/7118127/loading-data-from-site-as-stringandroid">loading data from site as String(Android)</a>
  <a href="https://stackoverflow.com/questions/11590899/downloading-a-website-to-a-string">Downloading a website to a string</a>
  <a href="https://stackoverflow.com/questions/238547/how-do-you-programmatically-download-a-webpage-in-java">How do you Programmatically Download a Webpage in Java</a></p>
  
  <p>---EDIT</p>
  
  <p>This is source code i'm working now, based on <a href="http://www.coderzheaven.com/2011/07/17/how-to-read-webpage-contents-as-a-string-in-android/" rel="nofollow noreferrer">http://www.coderzheaven.com/2011/07/17/how-to-read-webpage-contents-as-a-string-in-android/</a></p>
  
  <pre><code>    package tm.tresura;
  
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.UnsupportedEncodingException;
  import java.net.MalformedURLException;
  import java.net.URL;
  import java.net.URLConnection;
  
  public class HttpUtils {
  
    public static String getContents(String url) {
          String contents ="";
  
    try {
          URLConnection conn = new URL(url).openConnection();
  
          InputStream in = conn.getInputStream();
          contents = convertStreamToString(in);
     } catch (MalformedURLException e) {
          Log.v("MALFORMED URL EXCEPTION");
     } catch (IOException e) {
          Log.e(e.getMessage(), e);
     }
  
    return contents;
  }
  
  private static String convertStreamToString(InputStream is) throws UnsupportedEncodingException {
  
        BufferedReader reader = new BufferedReader(new    
                                InputStreamReader(is, "UTF-8"));
          StringBuilder sb = new StringBuilder();
           String line = null;
           try {
                  while ((line = reader.readLine()) != null) {
                          sb.append(line + "n");
                  }
             } catch (IOException e) {
                  e.printStackTrace();
             } finally {
                  try {
                          is.close();
                  } catch (IOException e) {
                          e.printStackTrace();
                  }
              }
          return sb.toString();
    }
  }
  </code></pre>
  
  <p>and errors:</p>
  
  <pre><code>Error:(76, 16) error: no suitable method found for v(String)
  method Log.v(String,String,Throwable) is not applicable
  (actual and formal argument lists differ in length)
  method Log.v(String,String) is not applicable
  (actual and formal argument lists differ in length)
  
  Error:(78, 16) error: no suitable method found for e(String,IOException)
  method Log.e(String,String,Throwable) is not applicable
  (actual and formal argument lists differ in length)
  method Log.e(String,String) is not applicable
  (actual argument IOException cannot be converted to String by method invocation conversion)
  
  Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
  &gt; Compilation failed; see the compiler error output for details.
  </code></pre>