简体   繁体   English

加载多个图像(Android 工作室 - Glide)

[英]Loading Of Multiple Images ( Android studio - Glide )

this question may sound dumb or irrelevant - but i would love to learn the way this problem will be solved这个问题可能听起来很愚蠢或无关紧要- 但我很想了解解决这个问题的方式

Surface Coverage Of The Working Of App: The Data Being Displayed On The Screen Is Dynamic, And Is Displayed In a Loop, The Images Are Also Being Loaded During the Loop - the URL for image and rest data is dynamically received应用程序工作的表面覆盖:屏幕上显示的数据是动态的,并且是循环显示的,图像也在循环中加载 - URL 用于图像和 rest 动态接收数据

Problem: Multiple Images Are Getting Loaded Slowly问题:多个图像加载缓慢

Detailed View Of The Problem The Images Are Being Fetched From Github And I'm using glide library to load the images from the url... the images are getting loaded fast when connected to a high-speed Wi-Fi but when speed is reduced to the average download speed of mobile.networks it takes a long time while loading the images问题的详细视图正在从 Github 获取图像 我正在使用 glide 库从 url 加载图像...连接到高速 Wi-Fi时图像加载速度很快,但速度降低时与mobile.networks 的平均下载速度相比,加载图像需要很长时间

PS- its a dumb question but would need this problem to be solved PS-这是一个愚蠢的问题,但需要解决这个问题

Code Snippet:代码片段:

loop
{
  ........

  Glide.with(getApplicationContext())
       .load(link[c]).centerCrop().placeholder(drawable)
       .into(imb);

  ........
}

I tried Using cache Method ( memory&disk ) and preloading but it only works when the image is loaded at-least one ( on a fast.network )我尝试使用缓存方法(内存和磁盘)和预加载,但它仅在至少加载一个图像(在 fast.network 上)时有效

-------------------------- --------------------------

if the answer to this problem is something around lazy load / progressive loading of images, then please give a detailed answer below如果这个问题的答案是关于图像的延迟加载/渐进式加载的,那么请在下面给出详细的答案

-------------------------- --------------------------

not sure whether the change should be done in the code or the way the image is accessed or from where it is accessed不确定是否应该在代码中或图像访问方式或访问位置进行更改

All I need to know is how do i load multiple images faster on a slower.network using glide or any other library ...我只需要知道如何使用glide 或任何其他库在较慢的网络上更快地加载多个图像 ...

Sounds like you're bound by the.network speed and the size of the images, not by the library.听起来你受网络速度和图像大小的约束,而不是图书馆。

The only solution that I can think of is to try to make your images smaller (eg a format with better compression, use a lower dpi, etc.).我能想到的唯一解决方案是尝试使您的图像更小(例如压缩率更高的格式、使用更低的 dpi 等)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM