Other APK file dimensions

udg

Expert
Licensed User
Longtime User
Hi all,
today I recompiled an old project of mine used as a family tracker based on GPS. No problem about the code, but when I was going to upload it to the server used for distribution I noticed that its apk file size grew from 182KB to 1MB. A bit too much, I think.

B4A 8.00
Libraries used:
Core (8.0)
dgUID (0.20)
GPS (1.20)
OkHttpUtils (2.61)
Phone (2.43)
RandomAccessFile (2.32)
RuntimePermissions (1.10)
AddManifestText(
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
CreateResourceFromFile(Macro, Themes.LightTheme) 'or Themes.DarkTheme
AddManifestText(<uses-feature android:name="android.hardware.location.gps"/>)
As you can see the only non-standard lib is my own dgUID but it was part of the previous version too.
I would say that the only "new entry" is Runtime Permissions but it couldn't be alone the cause of the whopping increment I noticed.

I tend to believe that the main cause is some kind of implicit compatibility code added by compiler/linker, but the only way to know it for sure is to ask here. TIA.
 

DonManfred

Expert
Licensed User
Longtime User
The old was probably using an old okhttp (v2) too. The new one is based on V3
Also the APK creation steps have changed in Android. Maybe here is "the problem".
 
Upvote 0

udg

Expert
Licensed User
Longtime User
The old was probably using an old okhttp (v2) too
Unfortunately, it's worse than that..eheh
I found a copy of the old code and it used HttpUtils (2.50)..so evidently when I updated the code I did something more than just adding permissions..
Anyway the increase in size appears really huge.

ps: today I just compiled and uploaded to the server (this partially explains why I forgot about the HttpUtils/OkHttpUtils revision)
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
would say that the only "new entry" is Runtime Permissions but it couldn't be alone the cause of the whopping increment I noticed.
RuntimePermissions depends on Google support library. This is the cause of the size increase.

Almost all Android apps reference this library and many also reference Google Play services which can add another 2mb. The bright side is that once these references are added you can add more features and libraries and the size won't grow much.
 
  • Like
Reactions: udg
Upvote 0
Top