を選択しますページを最初に選んで、私が望むものを選択しますが、最初にページ全体をダウンロードせずにサーバから最新の10個のアップデートをダウンロードする必要があります。 thanks予め、は、この中にコードダウンロードALLDATAの下に,,,</p> <p>を、JSONページからのみ最初の10の更新directyを取得し、最初のページ全体をダウンロードしていない私は、JSONのページからトップ10に新しいアップデートをダウンロードしたいことから
public String readFeed() {
StringBuilder builder = new StringBuilder();
HttpClient client = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(
"http://www.zigwheels.com/api/zigtvApi.php?method=data&module=News§ion=News");
try {
HttpResponse response = client.execute(httpGet);
StatusLine statusLine = response.getStatusLine();
int statusCode = statusLine.getStatusCode();
if (statusCode == 200) {
HttpEntity entity = response.getEntity();
InputStream content = entity.getContent();
BufferedReader reader = new BufferedReader(
new InputStreamReader(content));
String line;
while ((line = reader.readLine()) != null ) {
builder.append(line);
}
} else {
Log.e(GridViewExampleActivity.class.toString(), "Failed to download file");
}
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return builder.toString();
}
私はAndroidからそれを得る方法があると思う – Ti7a
あなたはどのように応答の半分をダウンロードするのですか? - 不可能 – MKJParekh
mmm Gsonを使ってどうしよう? – Ti7a