2

I have a recycleriew displaying list of installed apps. At first I took the icons directly from the ResolveInfo packages, however I noticed the slow performance, so I decided to parse all installed apps to my app's database and save icon images as encoded Base64 strings with 70% compression. Currently the performance is much better although the memory use is huge. I tried using Glide with them but still the same problem. Any suggestions please ?

Glide.with(context).load(decodedByte).into(holder.appIcon);

See the screenshot Screenshot

a_local_nobody
  • 7,947
  • 5
  • 29
  • 51
Mo Dev
  • 475
  • 6
  • 17
  • i might be wrong, but i'm pretty sure converting to base64 will not be improving performance, if anything it might make it worse : https://medium.com/snapp-mobile/dont-use-base64-encoded-images-on-mobile-13ddeac89d7c – a_local_nobody Aug 09 '19 at 18:35
  • I have to admit that changing to loading the app package icon improved the memory usage ( maybe in the past it was much worse as I was getting all apps from PackageManager not from DB) however still in terms of performance, loading a Base64 image is snappier! I don't know still what is the best approach for such circumstance . – Mo Dev Aug 09 '19 at 19:02
  • i'll be honest, i have no actual idea whether or not it's better or worse for performance (i'm no api dev and I just use what's given to me either way) but the process of decoding these in a recycler might be giving you a lot of issues. try looking at different cache settings for glide to help out potentially – a_local_nobody Aug 09 '19 at 19:05
  • Thank you for your suggestion. I tried now both glide caching and Picasso caching with a RequestHandler and it's working even snappier and faster! however still the large heap memory is present :( – Mo Dev Aug 09 '19 at 19:50

0 Answers0