How we brought down the size of our app from 31 MB to 2.6 MB and what it taught us

Written by irshadpi | Published 2018/02/09
Tech Story Tags: android | development | coding | productivity | software-development

TLDRvia the TL;DR App

TL; DR. Be stubborn when it comes to quality of your product.

Four weeks ago, I published my first application in Play Store. Before coming to the details of the story, here’s some background.

I am Irshad, a senior year computer science student at Government Engineering College, Thrissur. I’ve been into programming and application development for past few years.

The story starts around 5 months back; when one day, Atul Nair, who is in his sophomore year told me that he wants to learn Android Application Development.

The best way to learn anything is actually by doing it. and my advice was to make a simple Android app as a start and learn along the process. And I threw in a cliché idea of an app.

A cliché idea…

• An application that simply displays the recent statuses of other WhatsApp users with option to share and save them.• User can post videos longer than 30 seconds to WhatsApp. • User can post audio statuses by adding customize visualization and images. NB: WhatsApp status feature was still young at that time. so it sounded like a good idea.

So we started making it!

Here’s a rough sketch of the entire app which I drew that day.

(We codenamed it Project Mascot; No idea why 😂 )

And what happened?

Well, we divided the tasks into three.

  1. “Recents”
  2. “Video status”
  3. “Audio status”

I had the initial excitement and enthusiasm which made me build the “Recents” feature in 2–3 days since it was a fairly simple and familiar task for us.

Then I started assisting Atul in developing the Video status feature. As I had several other projects, it was mostly me doing only research on video libraries for Android and stuff while he tried out some actual code.

“Video status” Feature finished.. but wait…

Yeah, he was a good learner and within a week, he sent me an apk with video splitting feature as we talked about! It was all smooth and working, but there was just one problem!

The apk size was 31 mb, and I simply didn’t accept it.

We decided to use the famous ffmpeg library for the video processing. The easiest way to was to use the famous Ffmpeg-Android library by WritingMinds. We used the initial prebuilt libraries which was more than 27 mb themselves. this was causing the huge size of apk

I told him that we should work on it and reduce it as much as possible.

After some more research,googling and weeks, he comes to me again, and the apk size was 18 mb now!. and the app worked exactly the same as before. He followed this and included only the armv7 version of ffmpeg which helped in reducing app size by half.

So I said Ok. This is good! but not good enough! and I told him…

“The app size should be less than 5 MB. Otherwise, people are not gonna download it and hence, we’re not gonna release it”

And I was stubborn about it. I showed him some video editor apps in Play Store which takes only less than 5 MB and said “if they can do it; why can’t us?”

So we got back into it, But the project dragged a lot since both of us got busy with academic stuff and exams.

And one day, he messages me saying he brought it to less than 10 MB! (I told you this guy was good)

Ok that’s good enough.. but I was stubborn. I looked into some native development stuff and ways to compile our own ffmpeg for Android with only essential features. None of it worked out well.

Time dragged, days went by…. and one day he comes to me with a good news

He made it 2.6 MB! (that’s 12 times smaller than initial one!!!)

He was stubborn too!.. he researched it thoroughly all over the internet and found the right solution. Basically, he found a native C++ compiled .so file for ffmpeg with minimum features that includes the feature we want too. It was 4 MB. then he compressed it as aar which only took 2 MB. Here’s an analysis of the version 1.2 apk file.

(Oops.. it’s actually 2.9 MB now after the latest updates including support for WhatsApp for Business)

Package analysis of WhatSaga version 1.2.0

We also used features like proguard minify and drawable optimisation so that other resources didn’t take up much space. Things went faster, we didn’t wait to create the “Audio status” feature*. We launched our app on Play Store within couple of days!!

We named it WhatSaga, (because the name resembles WhatsApp and Saga means longer stories which was our primary feature!.) If you are the curious type, do checkout our app: https://goo.gl/nvjNRc

“Ok. So?”

Let’s get to the reason I am writing this article. Imagine if I had not been stubborn! I would have probably settled for the 10–15 MB solution or even worse. Which would have been terrible compared to a 2.6 MB

You might be asking if app size really matter so much in modern phones where users have Gigabytes of memory and bandwidth?

The answer is Yes!. App size matter more than you think.

If you have two applications which does the same thing with same UI, and one is slightly heavier by 3–4 MBs than the other, which one will you go for? The answer is obviously the lighter one. Less app size => More happy users

So what did I learn from this?

Be Stubborn!

Yeah!! Be stubborn about the quality of whatever you are making. Whether it be design, execution time or visual quality and appearance, anything; be stubborn and push yourself and your team to the limits. Never settle till your product has the quality you desire.

If you reached this far, thanks for reading this really long article. This is my first article on medium, so please excuse the mistakes and do give me feedback and suggestions :). Consider following me on twitter for more updates on my coming articles. Thank you!!

If you want to read about an extreme version of perfectionism, checkout Why the iPad has never shipped with a calculator app


Published by HackerNoon on 2018/02/09