Reputation: 2544
I want to build an android instant app from my previous app.My main source code is less than 4 MB (Instant App Requirement). But I am using some external libraries those have a size of approx 39 MB. How I can shrink the code to 4 MB?
Is there any possible way to load the libraries dynamically from the internet? Or shrink my code to 4 MB?
Upvotes: 0
Views: 287
Reputation: 2369
You can reduce your APK size greatly by using App Bundles, which will build split APKs for you (or just do the splits yourself). In your case, only one architecture will be delivered.
On that same page, you can also read about dynamic feature modules. You can develop them now, but uploading to Google Play isn't available to all developers yet.
This may not work for extracting a library unless it's well encapsulated with the user facing feature and code that uses it in your app. So, if your app can't launch without the library, it will not help much.
Also relevant, Google announced a 10MB beta program to increase instant apps size limit: http://g.co/instantapps/10MB
Upvotes: 1