3

Now that instant apps are a thing (and a great thing, in my opinion), I was wondering if there is a way to actually being able to download certain parts of your app (modules) in order to reduce the initial size of the APK.

For example, in my app I have a module that relies on a 3rd party library that increases the size of the APK in around 15 MB, and it only applies to certain users, so I would prefer to not to include that functionality in the final APK and make it optional.

So far, while this looks very similar to Instant Apps, I haven't been been able to find a solution to this problem, and I totally believe that many apps could benefit from something like this.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Jorge
  • 285
  • 2
  • 10

1 Answers1

1

If this 15 MB library is required for instant app functionality and there is no way for you to reduce its size any further, then you simply won’t be able to use it for your instant app. But you should still look into these guides to see if you can really reduce its size.

If it’s really not possible, but you think you can still proceed with your instant app without the use of that large library, then you can structure your project so that this library is only used in the installed-apk (full app version) and not in the instant app apks/features. It would then only be referenced by your installed-application module and not by your feature modules.

Your feature-modules, when built, will each become its own instant app apk, downloaded along with the base, and accessed only when the its supported intent-filter URL(s) are opened.

Prags
  • 2,457
  • 2
  • 21
  • 38
ManmeetP
  • 801
  • 7
  • 17
  • 1
    It is not for Instant Apps, I just wanted to use this as an example. What I wanted to achieve was just to download certain "features" (not necessarily Instant Apps features), like if it was a DLC for a game, so I can reduce the size of the APK – Jorge Feb 27 '18 at 22:45