apps-android-commons icon indicating copy to clipboard operation
apps-android-commons copied to clipboard

Reducing APK size

Open nicolas-raoul opened this issue 7 years ago • 6 comments

By @psh:

[...] I ran a couple of tests and the size is largely due to binary files included by mapbox - I suggest adding

android {

    ...

    splits {
        abi {
            enable true
            universalApk false
        }
    }
}

so that our build generates separate APK files for the different processor types that mapbox binaries are targeting. Each is only 8.7Mb in size! Adding this would mean uploading the 7 generated APK files when you release the app, but it would be a huge boon to users on limited data connections.

I agree that APK size is a very important thing as many of our users inhabit places where network and WiFi connections are rare, and data rates expensive. I would even say that they are our most important users, because they inhabit places that have very few Commons images.

Having several APKs may be bothersome to upload, but that can be solved by using a Google Play upload script. If someone could investigate this matter that would be great :-)

nicolas-raoul avatar Jan 16 '18 06:01 nicolas-raoul

#710 - but i'm fine with closing the older one in favor of this because it seems to describe the issue better.

EDIT: closed it.

whym avatar Jan 16 '18 07:01 whym

Yes sure. https://developer.android.com/topic/performance/reduce-apk-size.html

mithlesh4257 avatar Jan 20 '18 08:01 mithlesh4257

I tested the above mentioned code and 7 apk were generated. I had some doubt that whether we need to upload only one apk or more than one ? I came across some python script for same.

tanvidadu avatar Mar 07 '18 20:03 tanvidadu

With the recent version of the app (v4.1.0) the APK size has increase a bit more. This seems due to the switch from MapBox to MapLibre which is clearly adding 20MB in total to the universal APK. Approx. 5MB for each arch.

Below is a screenshot of the APK comparison b/w v4.0.5 and v4.1.0 releases:

image

We should check if there's anything that could be done to reduce this. @kartikaykaushik14 Do you happen to have any ideas on what could be done about this ?

sivaraam avatar Jun 15 '23 18:06 sivaraam

@sivaraam I'll try to analyze the dependencies and check if any unnecessary ones are added due to MapLibre.

kartikaykaushik14 avatar Jun 15 '23 19:06 kartikaykaushik14

As OP says, why not ABI split? :)

licaon-kter avatar Jun 16 '23 06:06 licaon-kter