Skip to main content
RU Digital Services
Android & Kotlin 3 min read •

Cutting Android APK Size and Battery Drain for Mid-Range Devices

Most users in South Asia run mid-range Android phones with tight storage and strict background battery killers. Here is our production checklist for lean, fast native apps.

MU
Muhammad Rauf
Principal Software Architect & CEO • RU Digital Services

If you only test your Android app on a flagship emulator with 12GB of RAM, you will miss what real customers experience on a 4GB RAM device running on 3G/4G data. Heavy APKs lower Play Store install conversion rates, and aggressive background polling gets your app force-killed by Xiaomi, Vivo, and Samsung battery managers.

1. Enable R8 Shrinking and Resource Shrinking in Release Builds

Always ship an Android App Bundle (.aab) with R8 enabled in build.gradle.kts. R8 strips unused library classes, inlines small methods, and removes unreferenced drawables:

buildTypes {
    release {
        isMinifyEnabled = true
        isShrinkResources = true
        proguardFiles(
            getDefaultProguardFile("proguard-android-optimize.txt"),
            "proguard-rules.pro"
        )
    }
}

Make sure you test the release APK thoroughly—any Retrofit/Gson/Moshi DTO class missing @Keep or serialization annotations can be obfuscated by R8 if not declared in proguard-rules.pro.

2. Convert PNG Assets to WebP and Vector Drawables

Replace UI icons with Android Vector Drawables (XML) and convert photographic PNGs to lossy WebP at 80% quality right inside Android Studio. On a typical e-commerce or academy app, this single step cuts media size by 40% to 65% with zero visible quality loss.

3. Eliminate Wake Locks and Tight Background Polling

  • Never run a foreground service or 15-second HTTP polling loop just to check for notifications—use Firebase Cloud Messaging (FCM) push notifications instead.
  • Batch periodic sync jobs through WorkManager with a minimum 15-minute interval and battery-not-low constraints.
  • Cancel coroutine scopes cleanly using viewModelScope and repeatOnLifecycle(Lifecycle.State.STARTED) so network collectors stop the instant the user backgrounds the app.

Lean apps under 15MB install faster on mobile data, crash less on low-memory devices, and earn significantly better Play Store reviews.

Written by Muhammad Rauf

Need help architecting a Laravel backend, Kotlin Android app, or joining our weekend engineering cohort?

Related Engineering Guides

All articles →
Send Inquiry WhatsApp Chat
Cookie & Privacy Notice

We use essential cookies to maintain security and authentication, as well as optional analytical cookies to deliver relevant content and analyze traffic. Read our Privacy Policy.