Asia

Reduce App size for Android in React native

25 January 2021

Introduction

In today’s world, user’s like to have apps, which is not too large, particularly in markets where devices work on pay by byte usage plans, so it is nice to have an app which is small in size. There are many techniques provided by Android to fulfill this requirement. Today we are going to come across one of such techniques which will immediately reduce the app size.

Upload App with Android App Bundles

Android supports both 32-bit and 64-bit architecture. It is always nice to have an app which is released with resources and code that are needed for a particular device. A way we can achieve this is by creating an .aab file instead of .apk file and upload it to Google Playstore, which is then managed by Playstore itself to distribute to specific devices.

How to achieve this in React native?

Now you would be thinking, why we are only talking about Android as this blog should provide information regarding React native, so for the folks who are new in React native to let them know React native is hybrid framework which uses both Android and iOS platform as base with JS layer on the top, to simplify it, React native uses bridging technique to bridge native with JS. In order to generate .aab file in React native, run the following command in the root directory of the project:

$ cd android

$ ./gradlew bundleRelease

After successful generation of AAB(.aab), one can find it at the below location and check the difference in size when installed on the device:

android/app/build/outputs/bundle/release/app-release.aab

 Are there other techniques to Reduce app size?

Yes, there are other ways to reduce app size even after generating .aab file, which I will not cover in this blog, but you can refer to below link to get more information:

https://developer.android.com/topic/performance/reduce-apk-size

Tudip Technologies

Tudip Technologies is a value-driven Software Services company. We deliver excellence in dedicated and business-centric web solutions incorporated with innovation and expertise as the tools to achieve business goals. Our high-quality, cost-effective, reliable, and scalable services have helped us build an enduring relationship with our clients and customers.

Latest Posts

  • All Posts
  • Casestudy
  • Cloud
  • Healthcare
  • Ios
  • IOT
  • Java
  • Manufacturing
  • News
  • OTT
  • Supply Chain
  • Support and Maintainance
    •   Back
    • Banking
Cloud-Powered Agility

December 27, 2024

27 December 2024 Introduction: Transforming Chaos into Opportunity Imagine a supply chain where disruptions are predicted before they occur, inventory…

Cloud-Powered Agility

December 24, 2024

Imagine a supply chain where disruptions are predicted before they occur, inventory is optimized in real-time, and every stakeholder works…

Related Posts

  • All Posts
  • Healthcare