Optimise bitmap decoding and release image memory in background

XMLWordPrintable

    • Type: Task
    • Resolution: Done
    • Priority: Low
    • 2.14
    • Affects Version/s: None
    • None
    • FLW Sprint 54, FLW Sprint 55
    • FLW Mobile App
    • UAT

      Some images are decoded at full camera resolution and kept in memory:

      • FormRendererAdapter.kt decodes base64 images with BitmapFactory.decodeByteArray inside RecyclerView binding, with no downsampling.
      • Base64 image decoding in VLFRepo, MaaMeetingRepo, SaasBahuSammelanRepo, UwinRepo and HelperUtil doesn't scale images down.

      Scope:

      • Load images through Glide (already a dependency), which downsamples to the view size and reuses memory.
      • Where a Bitmap is needed directly, decode with bounds + inSampleSize. Use the existing pattern in HelperUtil / IncentivesSubFragment.
      • Release Glide's memory cache in SakhiApplication.onTrimMemory() when the app goes to the background.

      Acceptance Criteria:

      • [ ] Android Studio Memory Profiler shows no full-resolution bitmaps held after leaving form screens or backgrounding the app.

              Assignee:
              Sushant Yadav
              Reporter:
              Nikhil Ananda Fegade
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: