Glance Tarun Kumar Anchala Sep 27, 2023

Glance TV Optimization Part 1: Shrinking APK Size by 65%

Article Summary

Glance TV's engineering team faced a brutal challenge: their Android TV app was 20.6MB and eating 515MB of RAM. Here's how they fixed it.

Tarun Kumar Anchala from Glance shares their systematic approach to optimizing an Android TV app that displays 2K/4K images, live news, and sports. This is part one of a series focusing on APK size reduction.

Key Takeaways

Critical Insight

The team reduced their APK from 20.6MB to 8.3MB (65% reduction), with users downloading only 7.7MB.

Part two reveals how they achieved an even more impressive 70% memory reduction from 515MB to 127MB.

About This Article

Problem

When Glance TV analyzed their APK, they found that resources took up 77% of the 20.6MB file size. Code minification alone wasn't going to cut it.

Solution

The team used Android Studio's refactor tool to delete unused drawable resources and added resConfigs to strip out locale-specific resources that weren't needed in the final APK.

Impact

After removing the unused resources and locale configurations, Glance reduced their APK from 20.6MB down to 8.3MB. The actual download size ended up at just 7.7MB, a 65% reduction overall.