Skip to content
Back to skills

Android Performance

ASecurity

The main issue is usually decoding the full network image into a `Bitmap`. Compressed network size is not the memory cost of the decoded bitmap; an ARGB image needs approximately `width × height × 4` bytes. Load a thumbnail at the size the `ImageView` actually displays, and let the image library cache the result. For example, with Glide, use a known pixel size for the target rather than the original URL dimensions: ```kotlin Glide.with(holder.imageView) .load(item.thumbnailUrl) .override(targ...

  • 584 stars
  • 0 votes
  • 0 copies
  • 10 views
  • Added September 5, 2026
developmentkotlin

Works with

  • cli

Security analysis

A100/100

Pro scans all 18 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add HoangNguyen0403/agent-skills-standard --skill android-performance --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Android Performance?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Android Performance
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hoangnguyen0403-android-performance-db629eb7/badge)](https://www.skillsdirectory.com/skills/hoangnguyen0403-android-performance-db629eb7)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
The main issue is usually decoding the full network image into a `Bitmap`. Compressed network size is not the memory cost of the decoded bitmap; an ARGB image needs approximately `width × height × 4` bytes. Load a thumbnail at the size the `ImageView` actually displays, and let the image library cache the result.

For example, with Glide, use a known pixel size for the target rather than the original URL dimensions:

```kotlin
Glide.with(holder.imageView)
    .load(item.thumbnailUrl)
    .override(targetWidthPx, targetHeightPx)
    .diskCacheStrategy(DiskCacheStrategy.RESOURCE)
    .placeholder(R.drawable.image_placeholder)
    .error(R.drawable.image_error)
    .transition(DrawableTransitionOptions.withCrossFade())
    .into(holder.imageView)
```

Glide's memory cache is enabled by default; choose the disk strategy based on whether the resized result or the source data is more useful to cache. With Coil, apply the equivalent request options: set the target `size`, enable memory and disk caching, and use `.crossfade()`.

Handle recycling explicitly. Clear the previous request and image in `onViewRecycled`, and also clear or replace the drawable when binding a holder, so a slow request cannot leave an old image in a reused row:

```kotlin
override fun onViewRecycled(holder: ImageHolder) {
    Glide.with(holder.imageView).clear(holder.imageView)
    holder.imageView.setImageDrawable(null)
    super.onViewRecycled(holder)
}
```

Do not retain `Bitmap` objects or `View`/Activity contexts in long-lived caches or singletons; use the application context for shared image infrastructure. Paginate large result sets and prefer server-provided thumbnails so the app does not download and decode unnecessarily large files. Avoid caching every full-resolution original in memory.

To verify the fix, use Android Studio's Memory Profiler and a heap dump while repeatedly scrolling. Look for large `Bitmap` allocations and retained image/view references, then compare peak and post-scroll memory. Also test fast scrolling and rotation/recreation: requests should be cancelled or reused, rows should display the correct image, and peak memory should remain bounded.

Files in this skill

  • eval-1.baseline.md3.4 KB
  • eval-1.with-skill.md2.7 KB
  • eval-2.baseline.md3.5 KB
  • eval-2.with-skill.md2.1 KB
  • eval-3.baseline.md3.2 KB
  • eval-3.with-skill.md2.1 KB
  • trigger-1.md119 B
  • trigger-10.md133 B
  • trigger-11.md130 B
  • trigger-2.md129 B
  • trigger-3.md118 B
  • trigger-4.md140 B
  • trigger-5.md123 B
  • trigger-6.md121 B
  • trigger-7.md122 B
  • trigger-8.md121 B
  • trigger-9.md138 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.