Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Easy Hacks For Reducing App Size By 60% (In Approximately 5 Minutes)

Application size really matters when going live to the play store. Many mobile app development companies in Dubai believe there are myriad ways to minimize the app size of the Android APK. Still, I will start funnelling down one of the most effective approaches which I used to reduce the size of the app.

But, before we jump to the quick fixes to reduce app size, let’s get familiar with the need to reduce the app size.

As already known by all, mobile devices have limited resources. They have a defined amount of battery, confined storage, limited processing power, limited RAM, curbed internet connectivity and the list goes on. However, this doesn’t matter if you are targeting Android app development or even iOS. This is the universal truth.

Also Read : HOW MUCH DOES IT COST TO DEVELOP AN APP LIKE INSTASHOP?

To have a better sight of understanding, let’s take an example of an Android App “Anti-Theft Screen Lock”. This app takes images using the device ‘s front camera, plays alert notification whenever someone tries to breach with a mobile password to have access to the device.

Here, I am unfurling the easy and effective tweaks and tricks I applied to minimize the app size. These tips and tricks will surely help you resolve your queries for present and potential applications to give the right start for your app’s market launch.

Is Smaller Always Better?

As an Android app developer, we always care about the application performance, design and user experience is the essential one. But, most of the developers forget (or belittle) one thing: “Application Size”. This is one of the decisive factors if you want to target the next billion users to your app.

To your surprise, there are more than 11,000 Android powered devices available in the market and most of them are having the pocket-friendly and low-end configuration, limited storage capacity (1GB to 8GB of internal storage) along with 2G and 3G connectivity. Undeniably, these devices are having the lion’s share in many countries, where it’s a plain sailing to find your next billion users.

Thus, keeping the app size intact and optimum is the new constant for the epitome app development company. The less your application user storage, the more user gets more space to store their information and data like images, videos, and files.

So, being fair and square, you don’t want your user to install your application just because of “Storage out of space” notification.

Some countries are also having constraints regarding limited 2G/3G connectivity. So, if your application is large, it will take a higher piece of time to download the app (and, there are more chances that users won’t download it in the first place). Besides, most of the users are having a confined limit of data. Every byte user uses to download the app, will for sure affect the user’s pocket.

Thus, it’s clear that in the world of mobile application, smaller is always better.

So, let’s start right away with tweaks and tricks to “How To Minimize Your Android App Size”.

The list skyrocket like this:

Proguard

This is used for code shrinking.

There are numerous code wrapping tools like Proguard that lends a hand to significantly eliminate or minimize the footprint of the code. Once you start implementing proguard to the written code, you need to test the app thoroughly as it swaps the symbols. You can explore more about this optimum tool over Google by searching for proguard from sourceforge.

APK Splits

The Split mechanism allows apps to be created for some forms of multi-APKs more efficiently than using flavours. This approach enables you to develop the APK for specific density and ABIs.

Vector Drawables

With the launch of 23.2 support library, Android is bracing the vector drawable for older versions of the Android devices. Android studio proffers a way to simply convert SVG to vector drawables. Here we don’t have to worry about the different devices DPI’s. This approach will significantly minimize the app size.

Google Play Services

Choose the compiling APIs exclusively.

In versions of Google Play services earlier to 6.5, you had to compile the complete package of APIs into your app. In some scenarios, doing so made it more tedious to keep the number of methods in your app (consisting frameworks APIs, own code, and library methods) under the 65,536 limit.

From versions 6.5, you can rather selectively compile Google Play service API’s into your own app. For instance, to consist only the Google fit and Android wear APIs, replace the following line in your build.gradle file:

“compile ‘com.google.android.gms:play-services:8.4.0’:”

with these lines:

“compile ‘com.google.android.gms:play-services-gcm:8.4.0’”
“compile ‘com.google.android.gms:play-services-wearable:8.4.0’”

Remove Unused Resources

The proficient app developers in Dubai make use of android-resource-remover utility that removes unused resources reported by Android Lint from your project.

Optimize PNG Image

PNG images can be minimized in file size without losing quality. To achieve this, it’s advised to use a tool such as OptiPNG and PNGCrush. They both are great for reducing PNG file size while still keeping intact the image quality.

9-Patch Images

A 9patch png is a special format for PNG images that can be used for backgrounds. Nine patch images prove to be special while designing buttons. Rather than defining a regular bitmap to be used as a background, a 9patch defines nine segments – for each of the four corners, the four edges, and the centre.

Even try to minimize the JPEG files as much as possible. For better use you can make the use of tools like Paint.NET.

Removable Debug Information

All the debug related information should be excluded, which is a considerable aspect to reduce the size of the Android APK. The application technically does not read or use this data, and the Android operating system can run the respective application seamlessly without this information.
However, to keep in mind is that the debug information only acquires more space, and should be deleted.

Give The Slip To Duplicacy

You need to make sure that the application doesn’t have any duplicate module or does not replicate any assets is a very common way to eliminate keeping unnecessary files in your APK. The most significant way is to understand which Android APIs you can integrate, and the complete set of features that each provides. A single API can server the purpose of many other APis and we need to make sure to figure out which is the most efficient one.

Duplicated elements (strings, bitmaps etc) also acquire a lot of space, and can be easily eliminated. To a lesser extent, cloned code will also unnecessarily increase the size of the delivered end product i.e the binary.

Exclusive Use Of Lint

Proguard works on the Java side. Unfortunately, it doesn’t work on the resources side. As an outcome, if an image my_image in res/drawable is not used, Proguard only strips its reference in the R class but keeps the associated image in place.

Lint is a static code analyzer that provides you with features to detect all unused resources with a simple call to ./gradlew Lint. It produces an HTML-report and gives you the exhaustive list of resources that appeared under the “UnusedResources: Unused resources” section. It is safe to remove these resources as long as you don’t access them through the reflection in your code.

To be precise, Lint analyzes resources (i.e. files under the /res directory) but skips assets (i.e. files under the /assets directory). While assets are accessed through their name rather than a Java or XML reference, as a consequence, Lint cannot determine whether or not an asset is used in the project. It is up to the professional to keep the /asset folder clean and free of unused files.

Reuse Resources Whenever Possible

Reusing stuff or resources is one of the first critical optimizations you learn when starting building on mobile. In a list view or a RecyclerView, reusing helps you keep the pace of scrolling performance smooth.

But reusing can also help you minimize the final size of your APK. for example; Android offers numerous utilities to recolour an asset either with the new Android: tint and Android:tintMode on Android L or the one old that fits all ColorFilter on all versions.

You can prevent packaging resources that are only a rotated equivalent of other resources. Let’s imagine you have two images named ic_arrow expand and ic_arrow_collapse:

You can quickly get rid of ic_arrow_collapse by crafting a RotateDrawable relying on ic_arrow_expand. This technique also minimizes the amount of time your designers need to maintain and export the collapsed asset variation.

Recommendations For Media Format

If your application solely depends upon heavy images, audio and video, another way you can minimize the APK size of your Android app is by using specific media formats. I personally recommend you to use the following listed formats for the respective media requirements like images, audio, and video:

Images: PNG or JPEG. Opt PNGs, while it’s a lossless format yet it is very suitable for textures and artwork as there will be no visual artefacts from the compression. Moreover, if there are space constraints, the Android app developer uses JPEG or an amalgam of PNG. a high quality JPEG image may work fine for large photo-realistic images, which the JPEG compression scheme is optimized for.

Video: It’s better to go for H264 AVC. encode the video to a specific resolution that is no bigger than the screen of the target device.

Audio: The top choice for Audio resource is AAC. AAC accomplishes better compression at a given quality, compared to MP3 or Ogg Vorbis. Raw formats like WAV should never be used. The common rationale for using the WAV format is that decoding compressed audio streams usually means higher latency at playback.

Nevertheless, Android proffers the sound pool API, which allows applications to use compressed audio streams without the cost of high latency.

In The End…
At present, there is a lot of requirement for Android Apps in the market, giving rise to the reliable Android app development. However, the biggest demur for the developers is to reduce the APK size too, without affecting the app performance.

So, to make this a seamless journey, Xicom is here to help you.

Their experts consider this scenario and thus provide you with easy tweaks and tricks which proves to be boon for your project successful launch with the utmost ease in minimizing the APK size.

If you have any question, feel free to talk to our experts at +971.529144795 or get your Free Project Estimation to a slimline application that will download faster and take up less space on the user’s Android device.



This post first appeared on THE BEST ETL TOOLS TO WATCH IN 2019, please read the originial post: here

Share the post

Easy Hacks For Reducing App Size By 60% (In Approximately 5 Minutes)

×

Subscribe to The Best Etl Tools To Watch In 2019

Get updates delivered right to your inbox!

Thank you for your subscription

×