Adb

 URL url=new URL(urlString);
    HttpURLConnection HttpURLConnection= (HttpURLConnection) url.openConnection();
    HttpURLConnection.setRequestMethod("GET");
    HttpURLConnection.setConnectTimeout(8000);
    InputStream inputStream = HttpURLConnection.getInputStream();
    StringBuilder StringBuilder=new StringBuilder();
    BufferedReader BufferedReader=new BufferedReader(new InputStreamReader(inputStream));
    String temp="";
    while ((temp=BufferedReader.readLine())!=null){

        StringBuilder.append(temp);
        temp="";
    }

    String s = StringBuilder.toString();
    return s;

} catch (Exception e) {
    e.printStackTrace();
}
return "";

你可能感兴趣的:(Adb)