How to reduce unity android game size? - android

Hello buddies I just build my first demo project in unity just for learning purpose and the size of apk file was 21 mb so how can I reduce my apk size?
I have seen many games that have size less than 5 mb, how do they build these kind of game?
Do they use some different game engines?
Thanks 😊

Assets are the most likely candidates for optimization. This information is available in the Editor Log just after you have performed the build. Go to the Console window
(menu: Window < Console), click the small drop-down panel in the top right, and select Open Editor Log.
The Editor Log just after a build:
Suggestions for reducing build size
Textures: select the Texture in the Project view, and in the Inspector
window reduce the Max Size.
Meshes and Animations: set the Mesh Compression to Low, Medium or High. Mesh and Animation compression uses quantization, which means it takes less space, but the compression can introduce some inaccuracies. Experiment with what level of compression is acceptable for your models.
Reducing mobile .NET library size: ou should avoid any dependencies on System.dll or System.Xml.dll. Unity does not include these in the built player by default, but if you use their classes, they are included. These DLLs add about a megabyte to the player’s storage size. If you need to parse XML in your game, you can use a library like Mono.Xml.zip as a smaller alternative to the system libraries. While most Generic containers are contained in mscorlib, Stack and few others are in System.dll, so you should avoid these if possible.
Refer to this link for more details.

of course you can override image size for android , but i recommend you to build under arm v7 architecture , not x86 + armv7 , there are few mobile phone now that uses x86 architecture , you can reduce you game until 11mb , In build section change architecture . If i answered your question please mark as answered

Related

To decrease the ANDROID13(AOSP) .img memory sizes

I have cloned the AOSP master source code and compiled it. All required .img files are generated in the OUT directory and the size of the overall image is 14.1GB.
Now I am trying to decrease the .img files to as much as possible.
Removed preinstalled apps, but not getting much effect on the sizes.
Can you please suggest/clue me, which is the better way to decrease the image size?
Note: My target device's memory size is too small(Less than 4GB) because of this I am trying to discrete the memory size. I just need to flash android not required all features like AB OTA, BT, camera, etc...

Android apk size less than 20kb

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.

How do I make my app use less storage?

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

Unity 3d build size too large

I am working on a unity project where the apk built is almost 200mb and the android phones is running it very slow.
I have already tried texture compression and I have brought down the size. Any other suggestions?
The frame rate is slow. My textures are at 256 compressed and PVRTC. Any suggestions, please.
I have read somewhere that I can load only what is needed, anybody who can help me with that ?
1.It is an autowalk cardboard type apk,the player triggers the button to walk.
2.I have imported a fully built house from maya.That is the largest import.The size of which is 800mb.
3.I used the profiler and it looks like the rendering is using too much of CPU.I see many apps that are professional built with even better graphics.Wonder how thats done.
#Joe Blow - Thanks for the edit suggestions, im new here :)
[1]: http://i.stack.imgur.com/4wvxQ.png - editor log
Try to do this, go to edit -> player setting -> other setting -> configuration -> device filter and change it to ARMv7 architecture and then build again your file will get reduce .If you Combine ARMv7 and x86 both architecture in a single apk then your file will get dobule

Compress APK for smaller file size

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.

Categories

Resources