<?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 Dharmin Majmudar on Medium]]></title>
        <description><![CDATA[Stories by Dharmin Majmudar on Medium]]></description>
        <link>https://medium.com/@dharmin007?source=rss-8912e2ab6952------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*oT93mQwDJWmrme_BLf9p6A.jpeg</url>
            <title>Stories by Dharmin Majmudar on Medium</title>
            <link>https://medium.com/@dharmin007?source=rss-8912e2ab6952------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 17:11:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dharmin007/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[Comparing APK sizes]]></title>
            <link>https://medium.com/android-news/comparing-apk-sizes-a0eb37bb36f?source=rss-8912e2ab6952------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0eb37bb36f</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[androiddev]]></category>
            <dc:creator><![CDATA[Dharmin Majmudar]]></dc:creator>
            <pubDate>Wed, 14 Mar 2018 07:33:41 GMT</pubDate>
            <atom:updated>2018-08-06T01:23:07.588Z</atom:updated>
            <content:encoded><![CDATA[<h4>For apps in Flutter, React Native, Kotlin and Java</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kTOVK9nX68CV2xkUwNlGbg.jpeg" /></figure><p>There are so many ways to make mobile apps ranging from direct platform specific development (using <em>Java</em> and <em>Kotlin </em>for Android, and <em>ObjC </em>and <em>Swift </em>for iOS<em>)</em>, there’s <em>React Native</em> from Facebook, <a href="http://www.electrode.io/site/native.html"><em>Electrode Native</em></a><em> </em>from Walmart, the <em>Ionic</em> framework, <em>Unity</em> for certain types of apps, and the <a href="https://flutter.io/">flutter.io</a> framework which was <a href="https://medium.com/flutter-io/announcing-flutter-beta-1-build-beautiful-native-apps-dc142aea74c0">just released by Google</a>.</p><blockquote><strong><em>Update</em></strong><em>: Minimal APK sizes for Flutter applications went down!! </em>“Overall release APKs are now 2MB smaller with those improvements. This brings the release APK size of a <a href="https://github.com/flutter/flutter/tree/60d223c20c44424e3c8031d019270d22bab35df6/examples/hello_world">minimal Flutter app</a> down to 4.7MB (from previously 6.7MB)”<em>. — </em><a href="https://github.com/flutter/flutter/issues/16833#issuecomment-410103493"><em>https://github.com/flutter/flutter/issues/16833#issuecomment-410103493</em></a></blockquote><p>Ever wondered how these libraries and frameworks affect the size of your app? Let’s analyze some apk files for apps written in some of these ways. The apps are very basic, containing just a title at the top and a text at the center of the screen. This will show, for a bare minimum app what these frameworks need to package along with the apk for it to be able to run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/338/1*nS-7Ji11bTmO5HIkmoYA-g.png" /><figcaption>Simple <em>Hello World</em> app</figcaption></figure><ul><li>For this test I created four different versions of the app, one in each of <em>Java, Kotlin, React Native, </em>and<em> Flutter. </em>(Android API 27)</li><li>The apks were then published for <em>release</em> type using Android Studio for <em>Java</em> and <em>Kotlin</em> and using the cli for <em>React Native </em>and <em>Flutter.</em></li><li>Default proguard configuration was used.</li><li>The apks were analyzed using the <em>Analyze APK</em> feature in Android Studio.</li></ul><h3>Java (539 KB)</h3><p>Lets start with the simplest one — <em>Java</em>. As you would expect this would be the smallest in size given that we are using just Java and the Android framework to create this app, with the only dependency being the Android Support Library, which you can see here takes up quite a lot of space.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*etBFAARt0K4yBa7d-nL0iQ.png" /></figure><p>We could potentially bring the app size down by removing this only dependency and using <a href="https://developer.android.com/reference/android/app/Activity.html">Activity</a><em> </em>instead of <a href="https://developer.android.com/reference/android/support/v7/app/AppCompatActivity.html">AppCompatActivity</a>.</p><h3>Kotlin (550 KB)</h3><p>Next up, the fancy kid on the block — <em>Kotlin. </em>If you have been coding a long time in<em> Java</em>,<em> Kotlin </em>is a breath of fresh air. The release apk for the Kotlin app comprises of everything that we saw in the Java apk, plus a tiny portion of <em>Kotlin </em>based syntactic sugar info.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Qo6ULUNQJtiHOHme_sFMg.png" /></figure><h3>React Native (7 MB)</h3><p>If you are coming from the web world and want to do <em>most</em> of the mobile development using javascript <em>React Native</em> is your go to option. It is also helpful if you want to iterate faster on a feature without releasing the app for every little change.</p><p>The release apk generated by <em>React Native</em> has a few classes in the <em>classes.dex </em>file that have 12193 referenced methods for this particular app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VkAuQM-fi3Fe7yKBiwKC6w.png" /><figcaption>Apk breakdown for Hello World in <strong>React Native </strong>(classes.dex)</figcaption></figure><p>It also adds some native dependencies in the <em>lib </em>directory for <em>x86 </em>and <em>armeabi-v7a</em>. Adding up to around 6.4 MB of dependencies in total.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IiScBxnU_MhURFzFYnDsug.png" /><figcaption>Apk breakdown for Hello World in <strong>React Native </strong>(native dependencies)</figcaption></figure><h3>Flutter.io (7.5 MB)</h3><p>The release app generated by<em> Flutter</em>’s cli contains the C/C++ engine and the Dart VM which makes up almost all the of the apk. The app directly runs using the native instruction set and no interpreter is involved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JqPvjrCDx4ShWNR10aP1UA.png" /><figcaption>Apk breakdown for Hello World in <strong>Flutter</strong></figcaption></figure><p>Every method of writing the app has its pros and cons (a future post will debate the pros/cons for each of these). Choose the method that makes the most sense for your use case and for your company. You can also mix and match some of these frameworks to make different parts of your app.</p><p>For example, if you are experimenting something make that component in <em>React Native,</em> if you want to share code between the iOS and Android app look into either <em>React Native </em>or <a href="https://flutter.io/"><em>Flutter.io</em></a><em>, </em>and if you are just focusing on Android and keeping the app size to a minimum is very critical you can go with either <em>Java</em> or <em>Kotlin.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0eb37bb36f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/android-news/comparing-apk-sizes-a0eb37bb36f">Comparing APK sizes</a> was originally published in <a href="https://medium.com/android-news">AndroidPub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Browsing your app’s shared preferences, database and cache files]]></title>
            <link>https://medium.com/android-news/browsing-your-apps-shared-preferences-database-and-cache-files-9fdabd4ff331?source=rss-8912e2ab6952------2</link>
            <guid isPermaLink="false">https://medium.com/p/9fdabd4ff331</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[android-studio]]></category>
            <dc:creator><![CDATA[Dharmin Majmudar]]></dc:creator>
            <pubDate>Sun, 29 Oct 2017 04:09:09 GMT</pubDate>
            <atom:updated>2017-11-04T07:29:09.900Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9EXaqdBQdtrSa9xk8cqang.png" /><figcaption>Android Device File Explorer</figcaption></figure><p>The <em>Device File Explorer</em> that is part of Android Studio 3.x is really good for exploring your preference file(s), cache items or database.</p><blockquote>You can use only an Emulator to explore these files as a real device doesn’t give permission to the <em>/data</em> directory unless may be it is a rooted device.</blockquote><p>To open up the <em>Device File Explorer </em>in<em> Android Studio </em>press <strong>Command + Shift + A </strong>to open the Actions menu and search for “Device File Explorer”.</p><p>Select the Emulator that the app is running on. The data you are looking for is located under</p><blockquote>/data/data/&lt;package-name&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gGPOWFv05EXb3DLbI6naiA.png" /><figcaption>Files under /data/data/com.dharmin.test</figcaption></figure><h4>1. Shared Preferences</h4><p>When you add something to the SharedPreferences in your app that gets added to a file under</p><blockquote>/data/data/&lt;package-name&gt;/shared_prefs directory</blockquote><p>It looks something like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*jUi3UlKGPmg2YgOFmSUyFQ.png" /><figcaption>A sample SharedPreferences file</figcaption></figure><h4>2. Cache Files</h4><p>Apps often cache images or other data. You can request the cache directory from Android using <strong>Context.getCacheDir()</strong>.<strong> </strong>When you create a file in that directory it shows up under</p><blockquote>/data/data/&lt;package-name&gt;/cache/&lt;your-file&gt;</blockquote><h4>3. Database</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wpns3pXmkkXmEa3N0jgHCw.png" /></figure><p>As you can see in the screenshot above the database used in your app shows up under</p><blockquote>/data/data/&lt;package-name&gt;/databases/</blockquote><p>You can download this database to your laptop and use the <a href="http://sqlitebrowser.org/">Sqlite Browser</a> to explore the data in it for debugging.</p><p>Being able to explore this data would help quickly figure out bugs that could be related to caching, SharedPreferences or data in the database.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2F3e491f%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2F3e491f%2F&amp;image=http%3A%2F%2Fapi.screenshotlayer.com%2Fapi%2Fcapture%3Faccess_key%3Dfe59908dad3baab69ffab249a2224b03%26viewport%3D1024x612%26width%3D1000%26url%3Dhttps%253A%252F%252Fupscri.be%252F3e491f%253Fscreenshot&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/fedb9f91e907af2468a937c944ed32ab/href">https://medium.com/media/fedb9f91e907af2468a937c944ed32ab/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9fdabd4ff331" width="1" height="1" alt=""><hr><p><a href="https://medium.com/android-news/browsing-your-apps-shared-preferences-database-and-cache-files-9fdabd4ff331">Browsing your app’s shared preferences, database and cache files</a> was originally published in <a href="https://medium.com/android-news">AndroidPub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Accessing Offline Data in Apps during Slow Network]]></title>
            <link>https://medium.com/@dharmin007/accessing-offline-data-in-apps-during-slow-network-a9027d825a90?source=rss-8912e2ab6952------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9027d825a90</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[apps]]></category>
            <dc:creator><![CDATA[Dharmin Majmudar]]></dc:creator>
            <pubDate>Fri, 06 Oct 2017 04:33:38 GMT</pubDate>
            <atom:updated>2017-10-06T04:33:38.383Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ea6NOaNh0GtG8g5F8LLtpQ.jpeg" /></figure><p>TL;DR — Disable your mobile network and WiFi; turn on airplane mode; or if you have an iPhone, disable mobile data for that one app and turn off WiFi if connected.</p><p>Ever stuck in a situation where you downloaded an app, downloaded some offline content like videos, music, maps or some other custom content for the app and then the app doesn’t load the content when there’s slow network?</p><p>That’s because most of the times to decide whether to use locally downloaded data or load fresh content from the internet, apps just check whether the device is connected to the internet. And technically the device IS connected to the network, it’s just that the network isn’t good enough to load data quickly. They don’t check how good of a connection it is.</p><p>Here are a few apps with such behavior on Android:</p><ul><li><em>Amazon Video</em><br>I downloaded a few videos in the app. The app works fine when the device does not have any network. But if the device has even the slightest network connection, it will try to load its home screen which is not going to happen, and it would not be able to reach the downloaded video.</li><li><em>Audible</em><br>This is an amazing app that serves audiobooks and podcasts doesn’t allow instant access to the downloaded items.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/268/1*eJywxvZJNKy007bQ4-DRzg.png" /><figcaption>Audible Android app stuck on loading screen on slow network</figcaption></figure><ul><li><em>Google Inbox</em><br>If you have multiple Google accounts setup on your device and if you open Google Inbox and try to switch the account, the side navigation panel doesn’t respond well until it has completed some network call.</li><li><em>HBO GO</em><br>This doesn’t even show a loading screen or any UI at all when the network is bad. This is a very poor user experience.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/268/1*YZhoUKjbkFlAqGahm2jMJQ.png" /><figcaption>No Progress Indicator for HBO GO</figcaption></figure><ul><li><em>Lynda</em><br>Great app to take courses online on your favorite topics. I had downloaded courses on this app but couldn’t access them because the network was slow.</li></ul><p>There are a couple of ways to try to use such apps for which you have downloaded some content previously. Follow any 1 of these steps and see if the target app allows you to access the downloaded content:</p><ol><li>Disable mobile data (and WiFi) for the entire device, which will force the app to load the offline content if anything is available.</li><li>Turn on airplane mode briefly till you can navigate to the desired content in the app, then turn off airplane mode.</li><li>On iPhone you can also disable data usage per app. Try doing that and turn off WiFi.</li></ol><p>If you are an app developer, it is worthwhile to consider such scenarios and handling low/no network conditions and create pleasant experiences for your users.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9027d825a90" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>