How do you handle Bitmaps in Android as it takes too much memory?

There are a number of reasons why loading bitmaps in your Android app is tricky:

  • Bitmaps can very easily exhaust an app’s memory budget.
  • Loading bitmaps on the UI thread can degrade your app’s performance, causing slow responsiveness or even ANR messages.
  • If your app is loading multiple bitmaps into memory, you need to skillfully manage memory and disk caching.

For most cases, Android recommend that you use the Glide library to fetch, decode, and display bitmaps in your app. Glide abstracts out most of the complexity in handling these and other tasks related to working with bitmaps and other images on Android.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s