Ich versuche Vorschau als Thumbnail aus Bildern im Web vor dem Download machen, es bedeutet, ich habe mehr Artikel auf RecyclerView
und ich versuche, einfache unscharfe Vorschau von Bildern zu sehen, aber ich weiß es nicht whats solution, ich benutze diese unter code, aber ich denke, dass dieser code herunterladen vollbild, wie mit sozialen anwendung wie whatsapp oder telegramm wie kann ich Vorschaubild im Web und zeigen, dass für die Benutzer?Android machen Vorschau von Bildern im Web
new Thread(new Runnable() {
@Override
public void run() {
//First create a new URL object
URL url = null;
try {
if (checkNetWorkConnection()) {
url = new URL("http://wallpaperwarrior.com/wp-content/uploads/2016/09/Wallpaper-2.jpeg");
//Next create a file, the example below will save to the SDCARD using JPEG format
File file = new File(APP.DIR_APP + APP.IMAGE + "/" + "Wallpaper-2.jpg");
//Next create a Bitmap object and download the image to bitmap
Bitmap bitmap = BitmapFactory.decodeStream(url.openStream());
//Finally compress the bitmap, saving to the file previously created
bitmap.compress(Bitmap.CompressFormat.JPEG, 50, new FileOutputStream(file));
}
} catch (MalformedURLException e) {
e.printStackTrace();
Log.e("Error ", e.getMessage());
} catch (FileNotFoundException e) {
e.printStackTrace();
Log.e("Error ", e.getMessage());
} catch (IOException e) {
e.printStackTrace();
Log.e("Error ", e.getMessage());
}
}
}).start();