Search code examples
androidapk

Does Android apk size affect app performance?


I use an OCR library inside my app. The "OCR.so" library is loaded only if the user selects OCR option. This OCR library has increased my apk file size from 700KB to 4.7MB. I would like to know whether this increase in apk size will have an impact on the performance of the app even for cases when the user is not selecting the OCR option?

In other words, the apk size is 4.7MB, but if I am not calling System.loadLibrary("OCR"), will the apk size have any impact on the performance of the app due to memory constraints?


Solution

  • The OS does not allocate memory depending on the apk file size. APK file is nothing but a zip file which is extracted into a folder during installation. When an App is opened, the OS loads the first executable file which in your case would be the main native library. Then which the native library loads other libraries, the other library files also get loaded. Otherwise, if you don't call system.loadlibrary, the OS won't load it to memory.