0

I am loading images in a recyclerView using picasso in my app. The image files are all local files. The problem is that the listview scrolling is not smooth, it is jittery. I searched about it and I saw that a lot of people have had similar problems but it is really strange that there is no clear solution available.

Horrible performance when loading local files

Picasso is awesome, but for loading local device images as thumbnails into a gridview (for example), Picasso is slower ...

Recyclerview painfully slow to load cached images form Picasso

From the above links it seems that picasso works great when fetching images from the web but for locally stored images it doesn't do that great.

Is it even recommended to use Picasso in this case? Should I have my own implementation of LruCache and remove Picasso? I have done it without Picasso using caching myself using LruCache. Though the scrolling is flawless in that case but Picasso is much more clean and compact, so I thought it might be the better solution in the long term.

Community
  • 1
  • 1
varunkr
  • 5,364
  • 11
  • 50
  • 99

1 Answers1

0

There could a lot of reasons for this kind of behaviour. One issue could be that your row layout may be very deep rather than being wide. Another issue could be the size of images, if images are of large size, there is a good chance that all of them might not fit into Picasso's cache.

If the problem is due to the size of images, you can try Fresco by Facebook. It is very good at loading large images. It uses native as well as ashmem cache, so it can hold large amounts of images in cache compared to other similar libraries like Picasso or Glide. Another thing you can do is, android:largeHeap="true" in your AndroidManifest.xml inside the Application tag.

Amit Tiwari
  • 3,684
  • 6
  • 33
  • 75