Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Controlling APK Size When Using Native Library

Controlling APK Size When Using Native Library

Brijesh Masrani

July 02, 2017
Tweet

More Decks by Brijesh Masrani

Other Decks in Technology

Transcript

  1. Outline • What are the major components in APK? •

    APK Splitting • What is ABI and how it works? • Understanding ABI in detail • Problems with ABI split • Solving Issues with abiFilters
  2. What are the major components in APK? • Class files

    • Resources • Manifest file • Native libraries
  3. Application Binary Interface • The ABI defines, with great precision,

    how an application’s machine code is supposed to interact with the system at runtime. • You must specify an ABI for each CPU architecture you want your app to work with. • mips, mips64, X86, X86–64, arm64-v8a, armeabi, armeabi-v7a
  4. Realm adds .so file for 5 CPU architectures mips, X86,

    X86–64, armeabi-v7a, and arm64-v8a this increases the apk size by 4.8 MB; remaining ~130KB is increased in dex size.
  5. Amazing right! We went from 74KB to 5MB and came

    back to 1.3 MB. But But But….