The apk file size for my app is quite big. Is it possible to reduce the file size by using better compression level or different compression engine such as lzma (https://software.intel.com/en-us/android/articles/native-library-compression-sdk-for-android-apps)?
To simply answer your question:
Yes, use lzma.
Okay, now some other recommendations.
Build in release mode. This is very important, as the app size when built in debug mode can be a lot bigger than when built in release mode.
Compress your images. Often when making an app you don't really look at the size of images, and they usually tend to be the main issue concerning size. Simply opening them in, let's say paint.net, and saving them again with lower quality can help a lot.
Compress your audio files. Load them up in audacity and export them as MP3 with lower quality.
These are some small recommendations of mine. If you need your apk to be smaller still, I'd suggest trying google
You may want to have a look at Crosswalk Lite, Which is a slim version of Crosswalk, with less features, but keeping the great performance.
The project still doesn't have a stable version ( Still in Canary channel ) to be used for production like normal Crosswalk.
I think Crosswalk Lite will be a great solution for problems like Yours, maybe in the near future.
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.
Need to build an android apk less than 20kb, and rest of the contents in the app should download dynamically, does anyone have idea about that.
If i create a simple android app and build it without any source code, it results in 3 MB atleast.
So, so pls someone suggest me how can we create an apk in kb.
I decided this would be a fun challenge, and was able to make a tiny app (no real functionality) that was 16kb. You can find the source code here. It would have been even smaller with only ldpi assets.
Some caveats:
Don't expect an app with any real functionality to come in this small. Keep in mind that 20kb is around 20,000 characters worth of data, which would be about the length of a very short story. 20kb really isn't realistic, and you are going to end up taking up that extra space on your user's phone when you download the "rest of the app" later anyway.
My example has only mdpi assets. Things like launcher icons have to be bundled with your application, so either your icon will look awful on large devices, or you need to modify your requirements.
Some tips:
Enable proguard. Both minification and obfuscation. The latter is a hyper-optimization, but when you are trying to go that small, every bit helps.
Take out any libraries that aren't absolutely mission critical. You aren't going to make it with any of the support library.
Support only the lowest resolution screens you can. ldpi assets will look bad on high density screens, but are exponentially smaller than mdpi, which is exponentially smaller than hdpi, etc. Resources are almost guaranteed to be the largest piece of the app.
Read all of the Shrink Your Code documentation. One great tip if you are using any libraries that provide resources is to use resConfigs to strip out any languages, densities, and native ABIs that you don't need.
Android Studio 3.0 has an "analyze APK" feature that will break down what pieces of the APK are taking up the most space- use that to identify your targets for cutting down the size.
I am making a launcher. Currently it takes up about 20 mb. What can I use to drop it to at most 9 mb?
Compress all your images with pngquant. It will reduce the size significantly atleast 30% i think.
Did you try to profile your apk?
I recommend you to figure out the problem by profiling apk.
Android Studio (2.2 Preview 1) has nice APK Analyzer.
http://android-developers.blogspot.jp/2016/05/android-studio-22-preview-new-ui.html
If the problem is classes.dex size, let's try Proguard to reduce the java classes.
https://developer.android.com/studio/build/shrink-code.html
I am working with unity 4.0 and my 2d game is almost completed, and ready to upload on Google Play Store. But the problem is that the APK size is very high. My total size of all Assets is 10.7 MB and the final APK size is 17.0 MB. So I can't understand how it happens.
Any help will be appreciated.
The APK does not merely consist of the assets. The Unity player is compiled into the resulting APK and explains the size of the APK being larger than the pure assets alone.
Check out this article in Unity's documentation.
You can reduce the size of the apk by doing:
Reducing the size of textures and compressing it
Reducing the poly count and compressing the meshes and animations
Minimizing the use of external imports
Using .NET subset when compiling
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.