如何更快地下载图像的Android排球/毕加索/滑翔任何其他? [英] How to download image faster in android Volley/Picasso/Glide any other?
问题描述
我开发的项目中,我必须从服务器上下载一些图片。我已经试过这3个方法。
I am developing project in which i have to download some images from server. I have tried these 3 methods.
毕加索:
Picasso.with(context).load(image).into(holder.image);
滑翔:
Glide.with(context).load(image).into(holder.image);
乱射:
imageLoader.get(image, new ImageLoader.ImageListener() {
@Override
public void onResponse(ImageLoader.ImageContainer response, boolean isImmediate) {
holder.image.setImageBitmap(response.getBitmap());
}
@Override
public void onErrorResponse(VolleyError error) {
}
});
毫无疑问,所有这些方法都在快速的Internet连接工作得很好。
但在2G它需要太多的时间,下载20KB的形象 - 25KB。
我也试过图像大小调整和一切。但没有得到来自良好的效果。
我看到的应用程序像亚马逊或Flipkart或这些应用程序在缓慢的互联网连接,并dowanloads良好的分辨率也全部图像工作得很好的电子商务应用。所以,我想对这些问题的一些专业的解决方案。
No doubt, all these methods are working very well in fast Internet connection. but in 2G It takes too much time to download image of 20kb - 25kb. I also have tried image resizing and everything. But doesn't get good result from that. I saw application like Amazon or Flipkart or any e-commerce application these apps are working very well in slow internet connection and dowanloads all images in good resolution also. So, I want some expert solutions on these problem.
推荐答案
滑翔,毕加索只是从服务器获取图像,并显示它。如果你的网络速度是较少的图像需要更长的时间来加载。需要重新大小在服务器侧的图像。使用的WebP格式而不是JPEG或PNG将有助于减少大小而不降低质量
Glide , Picasso are just Fetch image from the server and show it. if your network speed is less the the images take longer to to load. you need to re-size the images in the server side. Using WebP format instead of JPEG or PNG will help to reduce size without reducing quality.
请注意:您可以使用 Thumbor 轻松地做到这一点。
Note: you can use Thumbor to accomplish this easily.
这篇关于如何更快地下载图像的Android排球/毕加索/滑翔任何其他?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!