<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Avijeet Dutta on Medium]]></title>
        <description><![CDATA[Stories by Avijeet Dutta on Medium]]></description>
        <link>https://medium.com/@avijeet.dutta13?source=rss-f9e2e8bb5a54------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*X2XHASPv65W1O7U7gNhfBg.jpeg</url>
            <title>Stories by Avijeet Dutta on Medium</title>
            <link>https://medium.com/@avijeet.dutta13?source=rss-f9e2e8bb5a54------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 00:23:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@avijeet.dutta13/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Version 2.0]]></title>
            <link>https://medium.com/@avijeet.dutta13/version-2-0-6e696c97ef55?source=rss-f9e2e8bb5a54------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e696c97ef55</guid>
            <category><![CDATA[self-love]]></category>
            <category><![CDATA[philosophy]]></category>
            <category><![CDATA[self]]></category>
            <category><![CDATA[self-awareness]]></category>
            <category><![CDATA[self-improvement]]></category>
            <dc:creator><![CDATA[Avijeet Dutta]]></dc:creator>
            <pubDate>Sun, 06 Jan 2019 18:04:46 GMT</pubDate>
            <atom:updated>2019-01-06T18:04:46.708Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*R9nsQxHxakqOsV9HYP6VSQ.gif" /></figure><p>Well looking at the title of this post you must be thinking what does this mean? So let me tell you exactly that. First of all it has nothing to do with this famous <a href="https://en.wikipedia.org/wiki/Version_2.0">musical album</a>. It simply means the next version of yourself.</p><p>Let’s understand this in a bit more detail.</p><p>The next version of yourself means the better you. Now this could sound very subjective in itself but the idea is to make yourself feel and do better everyday. Let me illustrate this in some points to make it more clear.</p><ol><li><strong>Be a better Learner</strong>: Learning is a journey and it can never happen overnight, you’ve to pursue it consistently. It’s ok if you miss some days but you cannot afford to miss months or years by not learning things that either helps you in your day-to-day activities or things which will eventually help you in the long run. Learning can never be enforced by force, it can only come from passion. Some people have it inbuilt whereas other develop it in themselves by some external influence. But once you’re addicted to it, you’re ought to enjoy its hangover.</li><li><strong>Avoid any attempt of being the “Perfect” you: </strong>Well who doesn’t want to be perfect? And wait a minute if we’re talking about the “Version 2.0” of ourselves, shouldn’t we actually approach towards being perfect? Not really! Perfectionism is myth, you can always make it better. So you shouldn’t even attempt to be perfect, because that obsession can mislead you sometimes and may stop you completely from doing something good.</li><li><strong>Know your mindset: </strong>Now this one is the trickiest of all. If you know there’s a problem in your mindset about a particular thing or a situation and you should change it for good, then of course you should do it. But what if first you’ve no idea whether or not your mindset is good or bad? and second how’s it impacting the people around you? In my opinion for both the cases you should always have an Eagle’s eye on your mindset and constantly try to improve it.</li><li><strong>Give back to the society: </strong>If you’re just reading this post you should consider yourself lucky that you’re privileged to have access for things that many people in this world cannot even dream about. This means you should always appreciate the philanthropist in yourself. This doesn’t really mean you need to always do charity, but it means contributing to the welfare of the society by helping the underprivileged or the ones in need by different means.</li><li><strong>Live in the moment:</strong> We’re living in a world where we either linger to the past or worry about the future, both of which can be necessary at times for introspection but can be dangerous too. Living in the moment makes you aware about your surroundings and gather enough details to analyze and process. Now why is this important and it’s even there in this list? Well, it’s important because it helps you both in understanding how are you doing currently and what all things you need to improve. For the version 2.0 of yourself it’s important to keep signposting your progress every moment.</li><li><strong>Be compassionate: </strong>This is one of the key qualities that you should develop for any attempt of making the better you. With time an experience people could develop an egotist attitude, and this could be a result of many different things viz. money, knowledge, status etc. But none of these are justifiable for any ill behavior. What’s important is how you treat others irrespective of whatever you’ve possessed in your life.</li><li><strong>Love thyself: </strong>Nothing in the world is more important or I should say makes any sense if you don’t love yourself. Now what does loving thyself(yourself) actually means? It means regardless of all the shortcomings that you think you have in yourself, you still treat yourself in a good way. If you don’t love yourself you cannot love anything else in this world. Being self-critical could be sometimes important in order to introspect the loopholes and shortcomings that you might have and that can be corrected. But being truly self critical every time is going to lead you to darkness. Loving yourself means taking care of your mental and physical health. And you’re the only one responsible for that. If you feel good mentally and physically only then can you try to help others in need. So with the version 2.0 of yourself you should develop more love and respect for yourself.</li></ol><p>These are my 7 rules of creating version 2.0 of yourself. This is what I think everyone of us needs to develop in us in order to be a better human being. Please keep in mind the number 2.0 is just an illusionary number and is being used for illustration only. And this is because you can always make a better version of yourself of what you’re actually today.</p><p>Also, remember you’re the best person to judge yourself. Give this liberty to no-one else, this is a self healing process and a constructive enhancement of yourself. So, keep looking forward with all the zeal and vigor in you and do what actually makes sense to you, which makes you feel good and which is important and beneficial for the community and the society at large.</p><p>That’s all folks!</p><p>Please share your thoughts through comments on this blog post and let me know what you think about these 7 rules what additional rules would you included in creating your “Version 2.0”?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e696c97ef55" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iOS App Launch time analysis and optimizations]]></title>
            <link>https://medium.com/globant/ios-app-launch-time-analysis-and-optimization-a219ee81447c?source=rss-f9e2e8bb5a54------2</link>
            <guid isPermaLink="false">https://medium.com/p/a219ee81447c</guid>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[mobile-apps]]></category>
            <dc:creator><![CDATA[Avijeet Dutta]]></dc:creator>
            <pubDate>Sun, 27 Aug 2017 10:14:49 GMT</pubDate>
            <atom:updated>2020-09-10T08:37:27.226Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gOtFeO2p_WSenEhVFyhMig.png" /></figure><p>The first impression of any product is the most crucial for its long term success. The unboxing experience has to be the best, If that’s true for tangible products like mobile phones and so is true for Mobile Apps as well, which is the heart and soul of those physical devices.</p><p>When a user downloads an app from the AppStore all he cares about is: just click on the App Icon from the Home screen and experience everything the app has to offer as quickly as possible.</p><p>That being said no matter how fancy the <strong>“Launch”</strong> screens of the applications look like, maybe through beautiful animations or just mere transitions from the Launch screen through a Splash screen and finally the Welcome/Home screen.</p><p>Well, all that might sound obvious, but under the hood, the app developers are hiding their mistakes behind the launch screens without the consent of the Users. And if you’re a developer you must have already realized, what am I talking about. You see, doing so you’re killing the first impression of your Users and in general about your App itself. And not to mention the Users of such Apps might rate the Apps poorly and/or abandon the Apps altogether.</p><p><em>So what should you do…?</em></p><h4><em>First:</em></h4><p>Let’s analyze the problem statement, and to begin with we need to first understand the type of App Launches:</p><ol><li><strong>Cold Launch:</strong> This simply means the App process does not exist in the System’s(OS) kernel buffer cache. Consider the app is launched for the first time or the device has been rebooted and the kernel cache is cleared. This is the worst case for the app launch and hence should be considered for the app launch optimization analysis. This means every time you want to measure your app launch reboot the device.</li><li><strong>Warm Launch: </strong>This is the type of launch where the application process and data exist in the System’s memory and all that System does is bring the app to the foreground from the existing instance of the app in the memory. To simulate this the app can be just killed and relaunched again.</li><li><strong>Hot Launch:</strong> This launch means the app is not killed but could be backgrounded or suspended and the app is invoked and brought to the foreground.</li></ol><p>These three types of launches are common to both iOS and Android platforms. However, Android the third type of launch is referred to as <em>Lukewarm launch</em> which lies between the Cold and Warm launch types. In Android, this type of launch means that the application process might exist in the memory but the instance of the Activity has to be re-created from scratch. Or if both the process and Activity doesn’t exist in the System’s memory but the recreation of the <a href="https://developer.android.com/guide/components/activities/tasks-and-back-stack.html">Task</a> can be benefited from the <em>savedInstanceState</em> bundle, which is the parameter to the onCreate()<em> </em>method of Activity.</p><h4><em>Second:</em></h4><p>Let’s analyze the type of App Launch timings and see what we can do to make it better.</p><p>Coming back to the iOS world; The App launch time can be bifurcated into two:</p><ol><li><strong>pre-</strong><strong>main()</strong> time: This is the time before the UIApplicationMain<em> </em>is returned. Or to simply say, when your Application’s main()<em> </em>method is called and you get the control on the App by the OS. And you already must have realized so far, since this time is not in your control hence difficult to manage. However, dyld has a built-in measurement(An environment variable: DYLD_PRINT_STATISTICS) to analyze this. Which is as depicted in the snapshot below.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AH8yomKPFruKezlLnTC9DA.png" /><figcaption>Environment variable setting on Xcode to calculate pre-main time of the App</figcaption></figure><p>And as you must have already noticed the build configuration should be set to Release for the calculation, because this is the configuration with which the app will be released on AppStore. Also, it’s always recommended to do this exercise on an iPhone instead of a simulator. Once the configuration is done and the app is run, you would see the pre-main() timing details on the console something like this:</p><pre>Total pre-main time: 1.4 seconds (100.0%)<br>      dylib loading time: 1.1 seconds (77.4%)<br>      rebase/binding time: 242.40 milliseconds (16.6%)<br>      ObjC setup time:  33.04 milliseconds (2.2%)<br>      initializer time:  53.47 milliseconds (3.6%)<br>      slowest intializers :<br>      libSystem.B.dylib :  10.72 milliseconds (0.7%)</pre><p>This data gives you an abstract idea about what it could be in your app that causes it to launch slowly. To know in-depth about each of these types, I would recommend watching the WWDC 2016 talk on <a href="https://developer.apple.com/videos/play/wwdc2016/406/">Optimizing App Startup Time</a>.</p><p>As mentioned in the talk the major reason for your App slow startup time could be the use of multiple dynamic frameworks. While Apple recommends using only 6 but realistically speaking as your app includes more and more features, you tend to have multiple frameworks. Also, as you must already have been using Swift for your applications. Each application has to ship with the Swift standard libraries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*qZgSsmdRtq8eC5JQy2pE2g.png" /><figcaption>Swift dylib(s) shipped with each iOS App using Swift</figcaption></figure><p>Well, I believe these libs must be already optimized by Apple, but they still do exist. However, this is not in your control until we’ve complete <a href="https://swift.org/blog/abi-stability-and-apple/">ABI stability</a> for Swift. <a href="https://developer.apple.com/documentation/xcode_release_notes/xcode_10_2_beta_2_release_notes/swift_5_release_notes_for_xcode_10_2_beta_2">Starting with Xcode 10.2 and iOS 12.2</a> the Swift standard libraries will no longer be shipped with the apps. This would reduce the thinned IPA size by <strong>~9MB</strong>.<br>That being said the first and most important thing that you should consider doing is: Check for all your dependencies and if possible merge as many of them possible without breaking the logical boundaries of your application. The second step is to convert the dependencies to Static Frameworks instead of Dynamic Frameworks</p><p>Until Xcode 9, it was not possible to ship Swift frameworks as Static frameworks, but fortunately, Xcode 9 beta 4 onwards has <a href="https://github.com/apple/swift/blob/master/docs/ABIStabilityManifesto.md">ABI Source Compatibility</a>, which gives you the flexibility to ship Swift Frameworks as Static Frameworks as well. All you need to do is just change the Build settings of the Framework target(s) as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3HLijLYURd4LJbiI8GTPoQ.png" /></figure><p>Please note this applies true for both Pure Swift frameworks as well as Frameworks which has both Swift and Objective-C in them.</p><p>However, a matter of caution if you’re using Objective-C/Hybrid frameworks as static frameworks and exposing Objective-C classes or <a href="https://developer.apple.com/library/content/documentation/General/Conceptual/DevPedia-CocoaCore/Category.html">Category</a> to the Consumer application, you should ensure to setOTHER_LDFLAGS = “-ObjC” under <em>Build Settings</em> of the Framework(s) and of the Consumer application. An example is depicted in the screenshot below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GZrcsRK3IWA-D7BvBmvz4Q.png" /><figcaption>Build Setting to load all the members of static archive libraries that implement an Objective-C class or category.</figcaption></figure><p>Just by merging the frameworks and converting them to Static Frameworks, you would see a great difference before and after for the pre-main() launch time of the application. A simple illustration is shown below with 4 Framework dependencies:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ea7WO2B449pywp9FMm2GtA.png" /><figcaption>Dynamic vs Static Frameworks impact on pre-main() time</figcaption></figure><p>While this should help you win90% of the battle related to the pre-main() launch time of the app, the rest is related to coding best practices as illustrated in the WWDC talk: <a href="https://developer.apple.com/videos/play/wwdc2016/406/">Optimizing App Startup Time</a></p><p>Not only does static frameworks improve the app loading time, but they are also beneficial for the overall <a href="https://medium.com/@avijeet.dutta13/ios-app-size-analysis-76206a18a666">size of the app</a> as well.</p><p>With <strong>iOS 13,</strong> dyld3 will be included in iOS apps as well and this is a big improvement as this will make the iOS apps launch <strong>2x</strong> faster. This is a pretty good <a href="https://developer.apple.com/videos/play/wwdc2019/423/">video</a> from WWDC 2019 that explains all the optimizations in greater detail.</p><p>Moving on to next…</p><p>2. <strong>post-</strong><strong>main()</strong> time: This factor is something that you as a developer will have full control. Hence, this is very deterministic and easy to understand and manage. This starts through <a href="https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623032-application">application:willFinishLaunchingWithOptions:</a> and <a href="https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1622921-application">application:didFinishLaunchingWithOptions</a> of your AppDelegate all the way up to the ViewController(s) viewDidLoad andviewWillAppear methods is when your User can see the “Welcome/Home” screen of your App.</p><p>Needless to mention, if you’ve got a hierarchy for your AppDelegates and the initial ViewController, you would need to measure the time at all the levels combined at the methods mentioned above. You would always be tempted to put all your global initialization code in the AppDelegate’s lifecycle methods stated above; mostly in the <a href="https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1622921-application">application:didFinishLaunchingWithOptions</a> method. But you must realize that doing so would add more to your App launch time.</p><p>A thorough analysis should be done to do the bare minimum work possible during App Launch. And especially in this case, I would recommend making use of three different strategies internally in your AppDelegate’s <a href="https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1622921-application">application:didFinishLaunchingWithOptions</a> method:</p><ol><li>First Run Loop: This is a must-have for your app to configure during the first CFRunloop cycle. Ideally, this should be very minimum ~10% of the total work, you want to do during the App launch.</li><li>Second Run Loop: This is just a dispatch async on the main queue, but are the stuff that can be deferred to the second CFRunLoop cycle. This should also be as minimal as possible. And</li><li>Operations in the background: This is dispatch async on the global queue with thread priority as: DISPATCH_QUEUE_PRIORITY_BACKGROUND Ideally, this is your best bet. Try to defer as much non-trivial app launch work here as possible. Operations such as registration to Analytics, configuring components that aren’t immediately necessary during app launch time, etc. This will certainly gain you better benefits.</li></ol><h4>Finally:</h4><p>The simple equation comes out to be:</p><pre>pre-main() time + post-main() time = Total time of App Launch</pre><p>That being said, all of the above mentioned strategies should be religiously check listed for every release of your app in order to have a better experience for the Users and hence maximum retention of your product.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a219ee81447c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/globant/ios-app-launch-time-analysis-and-optimization-a219ee81447c">iOS App Launch time analysis and optimizations</a> was originally published in <a href="https://medium.com/globant">Globant</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android app size analysis]]></title>
            <link>https://medium.com/globant/android-app-size-analysis-759cc3dbdede?source=rss-f9e2e8bb5a54------2</link>
            <guid isPermaLink="false">https://medium.com/p/759cc3dbdede</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[mobile-apps]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[androiddev]]></category>
            <dc:creator><![CDATA[Avijeet Dutta]]></dc:creator>
            <pubDate>Mon, 26 Jun 2017 09:48:21 GMT</pubDate>
            <atom:updated>2020-09-10T08:37:05.065Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eCSV8jyRUFBK0AOpN9oL_A.png" /></figure><p>In my previous article, I talked about the <a href="https://medium.com/@avijeet.dutta13/ios-app-size-analysis-76206a18a666">app size analysis for iOS apps</a>. In this article, I’ll be talking about the same for Android apps. Clearly, when you’ve <strong>2B</strong> global active Users across the globe you would want your apps to reach out to the maximum based on your business. Also, this is important because a recent Google PlayStore statistics reveal that if the download size(OTA) of the app is greater than <strong>100 MB</strong> increases the chances of canceling the download of such apps on the User’s devices by <strong>20%</strong>.</p><p>And similar statistics apply for the install size of the app as well. Apps with more than <strong>100 MB</strong> install sizes are <strong>8</strong> times more likely to get uninstalled from the devices.</p><p><em>So what should you do?</em></p><h4><strong>1. Use ProGuard:</strong></h4><p>This is enabled by default for release builds.</p><pre>android {<br>    buildTypes {<br>        release {<br>            minifyEnabled true<br>        }<br>    }<br>}</pre><p>ProGuard is a whole program Java code optimizer. Mainly it does three important things:</p><p>a) It optimizes the code by changing the code representation without changing the core functionality.</p><p>b) It obfuscates the names of the types, methods, fields, classes, etc…And this increases the efficiency of the program.</p><p>c) Dead code elimination: This is the most important out of the three. An android program can be thought of as a graph where Classes, Methods, Fields as nodes and method calls and references as edges. Proguard keeps the direct entry points to the app and these entry points are nothing but the Android components(Activities, Services, Content Providers, Broadcast receivers, and custom application class) as defined in the App Manifest file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*bb1Vm-bwgN8GlMyhK29lpA.png" /><figcaption>Live Code vs Dead Code</figcaption></figure><h4><strong>2. Build multiple apks:</strong></h4><pre>android {<br>    splits {<br>        density {<br>            enabled true<br>        }<br>    }<br>}</pre><p>This feature tailors down the app to be installed on specific devices based on its screen density and CPU architecture instead of downloading/installing the universal apk which has the additional resources that will never be used in the device. This basically means to split your apps based on screen densities and CPU architectures and then uploading them on the PlayStore together. And if you think this is a lot of work; then don’t worry Google has a better way of managing this through <a href="https://developer.android.com/studio/publish/app-signing.html#sign-apk">Google Play App Signing</a> with additional benefits of heavy lifting the entire signing process of the app including safekeeping of the <em>App’s release keystore </em>to name a few.</p><h4>3. <strong>Use Vector drawable:</strong></h4><pre>android {<br>    defaultConfig {<br>        vectorDrawables.useSupportLibrary true<br>    }<br>}</pre><p>This simply means a <strong>single asset</strong> for all the screen densities. Android <a href="https://developer.android.com/topic/libraries/support-library/rev-archive.html">support library</a> version <strong>23.2 </strong>introduced the support for vector drawable backward compatible till <strong>API 14</strong>. Also, with <strong>Android N</strong> comes the support for the gradient in vector drawable. One important thing to note is complex vectors can slow down the CPU and RAM usage. So a thorough analysis should be done when you want to use vector images in the app. This is basically a trade-off between app size reduction vs app performance cost. Apps using vector images is comparatively smaller than the multi-app using <em>xxxhdpi</em> images.</p><h4>4. Remove unwanted alternative resources:</h4><pre>android {<br>    defaultConfig {<br>        ...<br>        resConfigs &quot;en&quot;, &quot;fr&quot; <br>    }<br>}</pre><p>The above Gradle configuration shows the app supports English and French only. This helps in eliminating unused resources from the app. For example, the string translations for the messages included in one or more of your app dependencies are in the languages that your app doesn’t support. Hence, with this setting, any resources for languages not specified are removed.</p><h4>5. Use Downloadable Fonts</h4><p>This is a new feature added in the Android platform. Google understood(through a survey of the top 25 apps on PlayStore) that most of the apps on the PlayStore use common fonts. Now since the fonts are bundled with the app, different apps on the device have duplicate copies of the fonts from the OS standpoint. Also, most of the fonts are not optimized for Mobile. Google came up with a solution to this problem through <em>Downloadable Fonts.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*w2XncPiuDwHxYtzpP_-6Iw.png" /><figcaption>Apps making use of common Fonts through Google Play Service’s Font Provider</figcaption></figure><p>Downloadable Fonts are on-demand fonts available through Google Play Service in the app. This is available from <a href="https://developer.android.com/preview/features/downloadable-fonts.html">support library 26</a>. This has many advantages viz. saving cellular data, phone memory, saving disk space to name a few. The font is fetched over the network when required. Using <em>Font Provider</em> helps you to make use of the entire slew of all the Google font catalogs(over <strong>800</strong>) through Google Play Services.</p><h4>6. Make use of APK Analyzer in Android Studio:</h4><p>This tool is the best you can get to understand what’s being packaged inside your app. So use this tool wisely to make informed decisions for your app. And with <em>Android Studio 3.0</em> and <em>AAPT2</em> this brings even more on the plate to offer. Especially and most importantly the inclusion of ProGuard mapping to map the files to the corresponding obfuscated code on the release builds. This helps you to understand the granular details included in your app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nlZVOBcplVmO6WkQP1pKQA.png" /><figcaption>APK Analyzer depicting App Size break-up and method count information.</figcaption></figure><p>Not only this, but you should also always consider comparing the latest apk with the previous apk of an App. This helps you to understand the delta between two versions of the app and validate the same. Maybe remove unnecessary stuff for the code based on the analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2sVGdSTTL8i6RS5ak3q4Mw.png" /><figcaption>APK diff between two versions of an App</figcaption></figure><p>Following these techniques should let you tighten the waistline of your app as much as possible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=759cc3dbdede" width="1" height="1" alt=""><hr><p><a href="https://medium.com/globant/android-app-size-analysis-759cc3dbdede">Android app size analysis</a> was originally published in <a href="https://medium.com/globant">Globant</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iOS App size analysis]]></title>
            <link>https://medium.com/globant/ios-app-size-analysis-76206a18a666?source=rss-f9e2e8bb5a54------2</link>
            <guid isPermaLink="false">https://medium.com/p/76206a18a666</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[mobile-apps]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[Avijeet Dutta]]></dc:creator>
            <pubDate>Sat, 17 Jun 2017 22:36:47 GMT</pubDate>
            <atom:updated>2020-09-10T08:37:16.459Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*nno_DVUlZZ6RR7r371Y_Gw.jpeg" /></figure><p>One of the most crucial pain points especially in building an enterprise mobile application is to constraint the app size well below the size limit. And by size limit, I mean the cellular download size limit(i.e. <strong>200 MB</strong>) by Apple. Although this is just a warning after iOS 11 was launched, however keeping the app size slimmer increases user retention.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*zXWVjYL-YDWivDtyqrZ-tw.png" /><figcaption>App Download Size limit warning</figcaption></figure><p>Now as your app grows in terms of features you offer because you’re always required to cater to your product needs, It’s sometimes difficult to make your app below the expected size limit. Doing an app size analysis is not only important but equally critical as Apple has stopped providing the App download size per device break-up information since <em>February 2017</em> on iTunes Connect. You would only get the App install size per device break-up information and a warning denoting if one or more of your binaries(<em>marked in bold</em>) is/are above the eligible download size limit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n8W8R2Ecky2IA379XH6usg.png" /><figcaption>App install size information of an app uploaded on iTunes Connect</figcaption></figure><p>You must always remember, your customers might not have access to WiFi always. And so downloading over the cellular network is the worst-case analysis that should be considered foremost. This is a concern and is not only important while you’re designing your app but also when you distribute your app on the AppStore.</p><p><em>So what should you do?</em></p><p>Well, there’re a few best practices that you should follow to make sure you tighten your App’s waistline.</p><ol><li><strong>Deployment Target:</strong> Change this to <strong>9 </strong>if you’re still supporting the older versions. As of <a href="https://developer.apple.com/support/app-store/">June 5, 2017</a>, <strong>97% </strong>of the Users are using <strong>iOS 9 </strong>and up… So I believe there’s no good reason to still support the older iOS versions. And this is because Sliced apps are supported on devices running <strong>9.0</strong> and later; otherwise, the store delivers universal apps to customers. And if you’re thinking what sliced apps are: So they are just the individual IPA(s) that are part of the Universal IPA that supports a non-simulator iOS architecture viz. <strong>arm64</strong>, <strong>armv7</strong> or <strong>armv7s</strong>. These are the processor architectures of your <em>iPhone/iPad</em>.</li><li><strong>File changes:</strong> Do not make unnecessary modifications to the files. Compare the contents of the prior and new versions of your app with diff or another directory comparison tool and verify that you&#39;ve only changed what you expect within your app bundle.</li><li><strong>Content changes:</strong> Content that you expect to change in an update should be stored in separate files from content that you don’t expect to change. This reduces the size of the <em>update package</em> and increases its install speed.</li><li><strong>Remove unnecessary resources:</strong> You may reduce the size of a resource by a lot, but after producing an .ipa file, you may discover the compressed size of that resource has not changed as dramatically. The most effective technique for reducing the size of an .ipa file is to remove unnecessary resources.</li><li><strong>On-Demand Resources:</strong> <a href="https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/On_Demand_Resources_Guide/index.html#//apple_ref/doc/uid/TP40015083">O<em>n-demand resources</em></a><em> </em>are just the app contents(any kind of resources) that are hosted on the App Store and are separate from the related app bundle that the user downloads from the AppStore initially. On-Demand resource also has sizes limits per platform on the AppStore and that can be found as below:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8_l1Qou0GbgFQPTNiGaZRA.png" /><figcaption>On-Demand size limit and slicing eligibility on AppStore</figcaption></figure><p><a href="https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/On_Demand_Resources_Guide/index.html#//apple_ref/doc/uid/TP40015083">On-Demand resources</a> are specifically important if you’re building a game because a game will have multiple levels and it makes more sense not to ship the resources(that will be required for the higher levels of the game) along with the IPA itself and make it bulky. This technique is analogous to having the app resources on the App server itself. If you’re shipping a preloaded DB with your App, make sure it has the minimum or rather important data that you think your Customer should have access to when he installs the app and has no Internet connectivity(again the worst-case analysis).</p><p>6. <strong>Asset Catalog</strong>: <a href="https://developer.apple.com/library/content/documentation/Xcode/Reference/xcode_ref-Asset_Catalog_Format/">Asset Catalog</a> organizes resources according to the relevant device traits viz. screen-size, screen-resolution, graphic capabilities(from <strong>iOS 9</strong> Onwards), and memory level(from <strong>iOS 9</strong> Onwards). Use of <em>asset catalogs </em>means Use of <em>1x</em>, <em>2x,</em> and <em>3x</em> — image sets and data sets. One important thing to note is: App Slicing will not be performed on <strong>loose</strong> resources. It must be a part of the <strong>Asset Catalog</strong>. <em>Content.json</em> in the Asset Catalog contains all the markup information for slicing the app resources based on the device traits.</p><p>7. <strong>iOS 9 APIs: </strong>has a new class: <em>NamedData</em> to thin any file not necessarily from Asset Catalog. It stores arbitrary file content. Classify according to the hardware capabilities. Use <em>NSDataAsset</em> class to retrieve content in the application.</p><p>8. <strong>Framework(s) sizes</strong>: You should always ensure that the Frameworks you’re using in your app are being created following the best practices as well. And while releasing a new version of your app or even releasing a new app altogether you should always unwrap the IPA file and check how much does the frameworks contribute to the actual size of the app. The download size is actually the worst-case scenario and is applicable only for first time users. For the existing Users, this doesn’t apply as they would always be required to download only the update package from the AppStore for every new release of the App, and the size of the update package will be much smaller than the download size of the app.</p><p>9. <strong>Use common asset catalogs: </strong>If your app uses multiple components, it’s very likely that they might have some or more of the assets in common. It is then very important to keep all the common assets in a shared area(asset catalogs), thereby not duplicating in multiple frameworks hence reducing the overall size.</p><p>10. <strong>Remove unnecessary code</strong>: This is similar to #4 with the difference that this is applicable to the source files, with a proper design and refactoring this is achievable. Removing the unwanted code will help you with reducing the size of the Unix executable file, thereby decreasing the overall size of the application.</p><h4>Additional Pointers</h4><ul><li>The AppStore IPA size is always larger than the estimated IPA size because of the inclusion of the .dSYM file for crash reporting and On-Demand resources.</li><li>The App size reduction analysis should only be performed on the thinned IPA and not on the Universal IPA.</li><li><em>App Thinning Size Report</em> gives information about the thinned IPA size and its characteristics. See an example below:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EIz5-lDlmTWFRvCW6dDUzQ.png" /><figcaption>An App Thinning report for iPhone 6s Plus</figcaption></figure><p>Now, this is the data of your interest. If you see in the <em>App Thinning Size Report </em>above, the <em>App size </em>has two values: compressed and uncompressed; the former denotes the App OTA(Over The Air) download* size for a fresh install from the AppStore whereas the latter denotes the App install size on the device, now this also varies based on the device and hence Users will see different sizes of the App while downloading the app from the AppStore. iTunes Connect will provide you the install size per device break-up information as I showed in an <a href="https://cdn-images-1.medium.com/max/1600/1*n8W8R2Ecky2IA379XH6usg.png">excerpt</a> before.</p><p>(*)A very <strong>important</strong> point to note here is the <em>compressed</em> size shown above is always smaller than the actual download size of the App as on the AppStore. And this is because the AppStore performs encryption on the app binary thereby increasing the overall size of the App. The encryption does not change the size of the binary, but the encrypted binary will have different compression characteristics, resulting in <em>.ipa</em> files from the App Store being larger than the size listed in the App Thinning Size Report. The size change is not unique to App Store’s encryption algorithm but is instead one of the normal consequences of any strong encryption algorithm. By design, strong encryption algorithms produce output that cannot be efficiently compressed.</p><h4>Conclusion</h4><p>The three main components of <a href="https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/AppThinning/AppThinning.html#//apple_ref/doc/uid/TP40012582-CH35-SW1">App Thinning</a> are <em>Slicing, Bitcode</em>, and <em>On-Demand resources</em>. And carefully examining each of these can help you keep your app slim.</p><p>In addition, this also requires you to take better architecture and design decisions for your app, which will give your several benefits viz. better code maintenance, code reuse, code modularity, scalability, and all these will lead you to gain: <em>Happy Customers</em>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76206a18a666" width="1" height="1" alt=""><hr><p><a href="https://medium.com/globant/ios-app-size-analysis-76206a18a666">iOS App size analysis</a> was originally published in <a href="https://medium.com/globant">Globant</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>