単に画像をダウンロードする必要がありますが、問題は画像が破損することです!!! 画像をダウンロードする方法はたくさんありますが、それでもこの問題が発生しました。
私はこれをしようとします:
File path = Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_PICTURES);
File file2 = new File(path,"DemoPictureX.png");
InputStream is=(InputStream) new URL("http://androidsaveitem.appspot.com/downloadjpg").getContent();
OutputStream os = new FileOutputStream(file2);
byte[] data = new byte[is.available()];
is.read(data);
os.write(data);
is.close();
os.close();
画像からいくつかの行を読んだだけだと思います!!!