私は最初のAndroidアプリを実行していますが、HTMLページのコードを取得する必要があります。
実際に私はこれをやっています:
private class NetworkOperation extends AsyncTask<Void, Void, String > {
protected String doInBackground(Void... params) {
try {
URL oracle = new URL("http://www.nationalleague.ch/NL/fr/");
URLConnection yc = oracle.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));
String inputLine;
String s1 = "";
while ((inputLine = in.readLine()) != null)
s1 = s1 + inputLine;
in.close();
//return
return s1;
}
catch (IOException e) {
e.printStackTrace();
}
return null;
}
しかし、問題は時間がかかりすぎることです。200行目から300行目までのHTMLを例に取るにはどうすればよいですか?
私の悪い英語でごめんなさい:$