<?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 Neha Bisht on Medium]]></title>
        <description><![CDATA[Stories by Neha Bisht on Medium]]></description>
        <link>https://medium.com/@nehabisht519?source=rss-ae876813181f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-7F-q_G3bHmgXyhP3g3bjg.png</url>
            <title>Stories by Neha Bisht on Medium</title>
            <link>https://medium.com/@nehabisht519?source=rss-ae876813181f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 19:52:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nehabisht519/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[How to reduce a Production React Native 0.81 APK Size]]></title>
            <link>https://medium.com/@nehabisht519/how-to-reduce-a-production-react-native-0-81-apk-size-3a82f6886d0e?source=rss-ae876813181f------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a82f6886d0e</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[mobile-app-optimization]]></category>
            <category><![CDATA[app-size-reduce]]></category>
            <category><![CDATA[rn-new-architecture]]></category>
            <category><![CDATA[production-apps]]></category>
            <dc:creator><![CDATA[Neha Bisht]]></dc:creator>
            <pubDate>Sun, 26 Jul 2026 08:26:16 GMT</pubDate>
            <atom:updated>2026-07-26T08:52:53.213Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y8ZOf0feW6-J8EV10uvGIQ.png" /></figure><h3>Step 1: Stop Building for the Museum (Target only arm64)</h3><p>Most generic tutorials tell you to “split APKs” by architecture. We went a step further. We realized that if your minSdkVersion is 29 or higher (Android 10+), you are exclusively serving 64-bit devices.</p><p>Why support 32-bit chips from 2014? You shouldn’t.</p><ul><li>The Reality: 95%+ of active devices run arm64-v8a.</li><li>The Play Store Mandate: Google requires 64-bit support anyway.</li></ul><blockquote>How we implemented it:</blockquote><p>In android/app/build.gradle, we told Gradle to stop building a “fat” APK and focus solely on modern hardware.</p><pre>gradle<br>def enableSeparateBuildPerCPUArchitecture = true<br><br>splits {<br>    abi {<br>        reset()<br>        enable enableSeparateBuildPerCPUArchitecture<br>        universalApk false  // Don&#39;t build the heavy universal version<br>        include &quot;arm64-v8a&quot;  // Only modern 64-bit devices<br>    }<br>}</pre><p>The result: By dropping armeabi-v7a and x86, we instantly reclaimed ~30% of our space.</p><h3>Step 2: Declutter Your Resources (Ditch the Dependencies’ Languages)</h3><p>Here is a sneaky one. Your app might only support English, Arabic, and French. But your dependencies (Google Play Services, Firebase, etc.) bundle translations for 50+ languages.</p><p>That is megabytes of wasted space.</p><p>The fix: In defaultConfig, explicitly tell Android to discard everything else.</p><pre>gradle<br>defaultConfig {<br>    // ...<br>    resConfigs &quot;ar&quot;, &quot;en&quot;, &quot;fr&quot;  // Keep only the languages you actually use<br>}</pre><p>The result: Several MB removed instantly. No code changes required.</p><h3>Step 3: Turn on the “Aggressive” Optimizers</h3><p>We enabled four flags in our release build type. If you aren’t using shrinkResources and crunchPngs, you are leaving free space on the table.</p><pre>gradle<br>buildTypes {<br>    release {<br>        minifyEnabled true          // Removes dead code<br>        shrinkResources true        // Removes unused drawables/assets<br>        crunchPngs true             // Lossless PNG compression<br>        zipAlignEnabled true        // Runtime memory optimization<br>        proguardFiles getDefaultProguardFile(&quot;proguard-android-optimize.txt&quot;), &quot;proguard-rules.pro&quot;<br>    }<br>}</pre><p><em>Note: </em>shrinkResources<em> works best when </em>minifyEnabled<em> is also true — they are a team.</em></p><h3>Step 4: The “No-Compromise” ProGuard Config (Battle-Tested)</h3><p>This is where most developers get scared. A bad ProGuard rule breaks your app. A good one removes 10% of your size.</p><p>We spent hours testing a configuration that keeps crash reporting (SourceFile,LineNumberTable) and React Native 0.81’s internals intact, while stripping out verbose logs.</p><p>Our proguard-rules.pro (Abridged but essential):</p><pre>proguard<br># Aggressive optimization passes<br>-optimizationpasses 3<br>-allowaccessmodification<br>-repackageclasses &#39;&#39;<br><br># Remove logs (Keep errors for debugging)<br>-assumenosideeffects class android.util.Log {<br>    public static *** d(...);<br>    public static *** v(...);<br>    public static *** i(...);<br>}<br><br># Preserve stack traces for Crashlytics<br>-keepattributes SourceFile,LineNumberTable,Signature<br><br># React Native 0.81 Core Keep rules<br>-keep class com.facebook.hermes.** { *; }<br>-keep class com.facebook.react.** { *; }<br>-keep class com.facebook.jni.** { *; }<br><br># Keep Native Methods<br>-keepclassmembers class * {<br>    @com.facebook.react.bridge.ReactMethod *;<br>}<br><br># Third-party libraries (Reanimated, SVG, FastImage, Firebase)<br>-keep class com.swmansion.reanimated.** { *; }<br>-keep class com.dylanvann.fastimage.** { *; }<br>-keep class com.google.firebase.** { *; }<br>-dontwarn okhttp3.**</pre><h3>Step 5: Confirm Hermes is Actually On</h3><p>Hermes is React Native’s secret weapon. It compiles JavaScript to bytecode, resulting in smaller bundles and faster startups. In RN 0.81, it is the default, but verify android/gradle.properties:</p><pre>properties<br>hermesEnabled=true</pre><p>If this is false, you are shipping a human-readable JS bundle (which is huge). If it is true, you are shipping optimized bytecode.</p><h3>How to Validate Your Build</h3><pre># 1. Clean the cache<br>cd android &amp;&amp; ./gradlew clean<br><br># 2. Build the release APK<br>./gradlew assembleRelease<br><br># 3. Check the output size<br>ls -lh app/build/outputs/apk/release/*.apk<br><br># 4. Bonus: Inspect what&#39;s inside (Android Studio &gt; Build &gt; Analyze APK)</pre><h3>The Final Checklist</h3><p>Before you ship, ensure you have checked every box:</p><ul><li>Architecture: Only arm64-v8a (or split appropriately).</li><li>Universal APK: Set to false.</li><li>Languages: Only your specific resConfigs.</li><li>Resource Shrinking: shrinkResources true.</li><li>ProGuard: Applied the “optimize” file and our custom rules.</li><li>Hermes: Confirmed true in gradle.properties.</li><li>Real Device Test: Verified the app launches and crashes report properly.</li></ul><h3>The Takeaway</h3><p>Reducing your APK size isn’t about choosing between performance and stability. By being precise about your target architecture, aggressive about resource stripping, and disciplined with ProGuard, you can have both.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a82f6886d0e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React native Localisation and Internationalization]]></title>
            <link>https://medium.com/@nehabisht519/react-native-localisation-and-internationalization-8153cb02136b?source=rss-ae876813181f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8153cb02136b</guid>
            <dc:creator><![CDATA[Neha Bisht]]></dc:creator>
            <pubDate>Wed, 04 Oct 2023 18:24:25 GMT</pubDate>
            <atom:updated>2023-10-08T14:46:36.608Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S_3gBwyJXVnT319Y2kzeug.jpeg" /></figure><p><strong>Localization</strong>, often abbreviated as “L10n” (since there are 10 letters between “L” and “n” in “localization”), is the process of adapting a product or service to meet the language, cultural, and functional requirements of a specific target market or locale. This process goes beyond just translating text; it also involves modifying various aspects of a product or service to make it culturally and linguistically appropriate for the target audience.</p><p>The goal of localization is to make a product or service feel native to the target audience, increasing its acceptance and usability in that market. Successful localization can lead to improved user satisfaction, higher sales, and a stronger market presence.</p><p>Localization is a complex and multifaceted process that involves not only linguistic expertise but also cultural knowledge, technical skills, and project management. Localization teams typically consist of translators, localization engineers, designers, and cultural experts who work together to ensure that the product or content is tailored to the specific needs of the target market.</p><h3><strong>Advantages of localization</strong></h3><ul><li>Elimination of hard-coded text (strings) in the code.</li><li>Support for right-to-left (RTL) languages, such as Urdu, Arabic, Hebrew, and Persian.</li><li>Reduced time to localize software in other languages.</li><li>Maintenance becomes easy for future iterations of the software.</li><li>Customer satisfaction.</li></ul><h3>Basic Requirements</h3><ul><li><a href="https://nodejs.org/">Node.js</a> installed on your computer</li><li><a href="https://facebook.github.io/watchman/docs/install#buildinstall">Watchman</a> installed if you are using macOS</li><li><a href="https://reactnative.dev/docs/environment-setup">React Native set up</a> and make sure that version of react-native &gt;= 0.60</li></ul><h3>Installing Dependencies</h3><pre>yarn add react-native-localize</pre><pre>yarn add i18n-js   </pre><pre>yarn add lodash.memoize </pre><p>Create a file named <strong>en.json</strong> and add some strings with their respective translations like this: -</p><pre>{<br>  &quot;welcome&quot;: &quot;welcome&quot;,<br>  &quot;localisationInReactNative&quot;: &quot;Localisation in React Native&quot;<br>}</pre><p>And then create a file translationHelper.js with the following code: -</p><pre>import i18n from &#39;i18n-js&#39;;<br>import memoize from &#39;lodash.memoize&#39;;<br>import {I18nManager} from &#39;react-native&#39;;<br>import * as RNLocalize from &#39;react-native-localize&#39;;<br>export const translationGetters = {<br>  en: () =&gt; require(&#39;./en.json&#39;),<br>};<br><br>export const translate = memoize(<br>  (key, config) =&gt; i18n.t(key, config),<br>  (key, config) =&gt; (config ? key + JSON.stringify(config) : key),<br>);<br><br>export const setI18nConfig = () =&gt; {<br>  // fallback if no available language fits<br>  const fallback = {languageTag: &#39;en&#39;, isRTL: false};<br><br>  const {languageTag, isRTL} =<br>    RNLocalize.findBestAvailableLanguage(Object.keys(translationGetters)) ||<br>    fallback;<br><br>  translate.cache.clear();<br>  I18nManager.forceRTL(isRTL);<br>  i18n.translations = {[languageTag]: translationGetters[languageTag]()};<br>  i18n.locale = languageTag;<br>};</pre><p>Now, inside your App.js file, make these changes:-</p><ul><li>Import setI18nConfig() from translationHelper file which you have created &amp; make a function inside which call this function like this</li></ul><pre>import {setI18nConfig} from &#39;./src/translations/translationHelper&#39;;<br><br>const handleLocalizationChange = () =&gt; {<br>    setI18nConfig();<br>  };</pre><ul><li>Now, while mounting the app add the handleLocalizationChange listener and make sure to remove the same listener on unmounting the application. You can write this code like this: -</li></ul><pre>  useEffect(() =&gt; {<br>    setI18nConfig();<br>    RNLocalize.addEventListener(&#39;change&#39;, handleLocalizationChange);<br><br>    return () =&gt; {<br>      RNLocalize.removeEventListener(&#39;change&#39;, handleLocalizationChange);<br>    };<br>  }, []);</pre><ul><li>To display the localised text into your application, you need to call the translate function which we have created in translationHelper file, and pass in the key that you want to translate as a string. For example: -</li></ul><pre>import {translate} from &#39;./src/translations/translationHelper&#39;;<br><br>&lt;View&gt;<br> &lt;Text&gt;{translate(&#39;localisationInReactNative&#39;)}&lt;/Text&gt;<br> &lt;Text&gt;{translate(&#39;welcome&#39;)}&lt;/Text&gt;<br>&lt;/View&gt;</pre><p>Now, you can run the app using: -</p><pre>npx react-native run-ios </pre><pre>npx react-native run-android</pre><figure><img alt="Output" src="https://cdn-images-1.medium.com/max/1024/1*Kl9WlXD3d_k9VLgHWs3B3g.png" /><figcaption>Output</figcaption></figure><p><strong><em>Note</em></strong>: React-native-i18n has some really good properties &amp; methods like fallback, isRTL, allowRTL.</p><ul><li>fallback- when set true, then if we don’t specify what the text for a key is in English, the text will fall back to the default language.</li><li>allowRTL(boolean) &amp; isRTL- these two functions are convenient while dealing with languages (like aArabic)that follows right-to-left convention while they are written.</li></ul><p>In summary, internationalization lays the foundation for localization. It in volves designing and developing a product or system in a way that makes it adaptable to different languages and regions, while localization takes the internationalized product and makes it culturally and linguistically suitable for a particular target market. Both processes are essential for effectively reaching a global audience and ensuring a product’s success in diverse markets.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8153cb02136b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>