I have almost finished writing my app, and i am concerned about the app size. Besides the 876KB res folder and the 1,08 MB assets, the rest of the files in the project are just source code in src (the src is about 80KB). The app can download a ~160KB file from the web. From the app info (in the app settings), says the following:
Total ............5.89MB
App ..............1.79MB
USB Storage app.. 4.09MB
Data ............12.00KB
SD Card.......... 0.00 B
The app is saved on the SD card.
The question is, is there a way to reduce that size? I have already compressed the images I am using and it seems really weird to me that with the size of the folders in the project, the app needs 6 MB of space.
Also, how come the app size is bigger when the app is in the SD card?
Consider using proguard here in your app. With latest tools, proguard is on by default.
Also, do not consider the size of app until you have obfuscated it.
ActionBarSherlock adds about 200KB to your apk size not MBs.
Related
A work app I am working on is currently being generated at over 300mb, when in reality it should be around 70mb. I'm aware of the changes Android made whereby native libraries were not being compressed but the size of the APK being generated seems extreme to me. Setting extractNativeLibs="true" seems to have no effect either as i've tried this. below link is a screenshot to show what's obviously causing the issue but I'm stuck on what else I could try to compress the file further?enter image description here
The native libraries you're pulling are huge, compressed or not. Just the library libtwilio is taking 85 MB, then it's present for 4 different device architectures so I'm not surprised the total size is around 300MB.
You should be using the App Bundle so that the libraries of only one architecture is sent to each device of your users. This will considerably reduce the size of the APK that your users are downloading (the size of the App Bundle will still be big, but that only affects what you upload to the Play Console).
Note that even with App Bundle, you'll still be around 100 MB per split APK, so make sure that you really need this library. If it's not a core feature of your app, you can also consider extracting as a dynamic feature so it's only downloaded by your app when the user needs the feature. That would further reduce the size of the initial download.
Bare with as this is my first ever question.
I'm developing an Android application and I was ready for it to be reviewed by Google and uploaded to the Playstore. It's a simple book reading application which uses individual .png files as the pages to scroll between and I use a ViewPager to view them. I was unaware that Google had a limit on the app size that you can upload at 150mb. This is the error I am receiving
The original size of my drawables folder was 761mb. I have been able to convert it down significantly to 250mb however it is still 102mb over the limit. Minify is enabled. I have tried the Webp convert in Android Studio but it barely makes a difference. Using AAB also create more than a 10mb difference. Click for APK Aalyzer.
Anyone know anything else I can do? I've tried to convert over the images again but it doesn't make any difference to the size. I would want the images to be saved on the device rather than downloaded from the internet so that it can be viewed offline. I have looked into expansion apk's but all of the documentation points towards it only being saved in external storage.
Your solutions:
If you do not want to receive images from the server, try to reduce the size of your photos(compress) with the following two sites:
https://tinypng.com, https://tinyjpg.com
Convert your images to webp (in android studio right click on drawable image and click convert to webp)
Recommended use https://appicon.co/#image-sets to Get different sizes of your images ( mdpi, hdpi, xhdpi, xxhdpi , xxxhdpi )
I was doing a little project thing for my school...
I made a simple calculator app...with simple mathematics operations...
And when the apk file is created and installed, it was consuming the memory space of more than 700 kb in the phone.
While in the android market(play store), there are just similar apps which are of low sizes and are taking memory space of less than 500. I was creating app in eclipse...
Will somebody plz help me out with this that how they do make apps of simple lower size.??
The smallest APK I created is ~35kB. Size increases dramatically with the included assets. Check the size of your /res, /assets and, if you have it, /raw folders. The APK size will be larger than those three combined. Further, any included lib counts, and adds bulk, even (and especially) the compatibility library, if you use it.
If you're having lot of graphic assets, then you should probably look at using 9-patches. They save a lot of memory.
Please elaborate your question. When you say memory, are you referring to the RAM OR the actual storage memory ?
If you are referring to storage memory...
The storage memory depends on how big your application is. For e.g. IF you have too many images of large size, then app size will increase.
By the way, 700K is not really too much. You are OK.
I am a Android developer with some games published on the GooglePlay. Actually i have 2 apk files for OS version (one with mutitouch support 2.0+ and the other without mutitouch support 1.5+) using the multiapk support existing on GooglePlay.
The 2 apk's has high resolution assets for HD devices but in some old phones causes Memory problems loading and re-scalign hd images.
To solve this problem i want to build my apk with low res assets (more compatibility, better memory allocation) and build another apk with only the high resolution assets.
APK 1: the game (with low res graphics)
APK 2: high resolution assets for the game
The user donwloads the game and, when it's started, the game check the screen resolution and asks the user if wants to download and install high resolution assets.
I don't want to use the multiple apk because it's too dificult to mantain (4 apk's). It's any solution i can use to do that?
Something like expansion pack but in the internal memory (structure of the app)
Thanks.
Ricard.
What you can do to limit work overload is to have two Android Libraries, oner with small graphics and one with HD, and make your application use one or the other lib at compilation time. Of course you'll need to make sure the drawable names and layouts and ids are exactly the same. This creates more apk but it can be done in no time. Note that you could limit this to 2 APK, by detecting programatically the OS version :
if (VERSION.SDK_INT < VERSION_CODES.ECLAIR) {
// use single touch
} else {
// use multi touch
}
You can also use your idea of a HD Pack, downloaded from the market with jsut your drawables in them. You can access resources from your second app using the following code :
Resources res = context.getPackageManager().getResourcesForApplication("com.example.foo")
Then you would need to know exactly the correct drawable ids to load the correct one or just use reflection.
Another option would be to store an archive with all your drawable, download them from your own server into the application sandbox and read them from the disk instead of from the resources.
guys, I wonder if you put images for each density type (low/medium/high) and there are quite a few of them, won't it increase the size of application footprint on internal memory?
I would hope that android will put only needed resource file from apk to the actual application folder. Can somebody confirm that?
It will increase the size of the .apk, because those images need to be in the .apk. It will not increase the RAM footprint of the app at runtime. When an app is installed it is kept as its original .apk, so the storage space needed will be basically the size of your .apk.