. - - , HTTP.
HttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet(endpoint);
HttpResponse response;
try {
response = httpclient.execute(httpget);
if (response.getStatusLine().getStatusCode() == 200) {
HttpEntity entity = response.getEntity();
if (entity != null) {
InputStream instream = entity.getContent();
String path = "/storage/emulated/0/YOURAPPFOLDER/FILENAME.EXTENSION";
FileOutputStream output = new FileOutputStream(path);
int bufferSize = 1024;
byte[] buffer = new byte[bufferSize];
int len = 0;
while ((len = instream.read(buffer)) != -1) {
output.write(buffer, 0, len);
}
output.close();
}
.
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int bufferSize = 1024;
byte[] buffer = new byte[bufferSize];
int len = 0;
try {
while ((len = instream.read(buffer)) != -1) {
baos.write(buffer, 0, len);
}
baos.close();
} catch (IOException e) {
e.printStackTrace();
}
byte[] b = baos.toByteArray();
Bitmap bmp = BitmapFactory.decodeByteArray(b, 0, b.length);
ImageView imageView = (ImageView)findViewById(R.id.picture_frame);
imageView.setImageBitmap(bmp);
FYI - android UI ( async, ).
..