Giter Club home page Giter Club logo

Comments (9)

martinspaeth avatar martinspaeth commented on May 12, 2024

I just found an interesting blog post about that topic you might find interesting:
https://realm.io/news/reducing-apk-size-native-libraries/

We will tinker around with different apk files per architecture (also linked in the original article):
https://developer.android.com/studio/build/configure-apk-splits.html
I will keep you up to date about the progress on this our side!

from liquidcore.

ericwlange avatar ericwlange commented on May 12, 2024

Yeah, I referenced that article in AndroidJSCore.

There is not much I can do with libnode.so. It is what it is. I stripped everything out of it that had any bulk (especially ICU which is a pig). However, I have to say that I am surprised that libliquidcore.so is the same size. It should be nowhere near that big. I may have unintentionally left all the symbols in it. I'll take a look at it. That should reduce the size dramatically.

As you rightly note, if you are really concerned about APK size, you will need to do an APK split. I had considered publishing separate libraries for each arch, plus one big multi-arch one for those who aren't concerned about size, but I never really got around to it.

from liquidcore.

martinspaeth avatar martinspaeth commented on May 12, 2024

No Worry the size of ibliquidcore.so is only the smallest one here (1.2 MB compared to lobnode.so 17.7 mb).

We are currently using libliquidcore via gradle.
To split the apk's i will have to include the library as described in
"Building the LiquidCore Android library"?

And thank you for referencing me to the article in the deprecated project i seem to missed this!

from liquidcore.

ericwlange avatar ericwlange commented on May 12, 2024

Maybe. I haven't actually tried it. It may be possible to do the APK split from the app itself. Android Studio may be smart enough to ignore anything not related to the ABI.

from liquidcore.

martinspaeth avatar martinspaeth commented on May 12, 2024

Ok we will check it out and keep you up to date! thank you!

from liquidcore.

ericwlange avatar ericwlange commented on May 12, 2024

Just came across this when working with React Native: https://developer.android.com/studio/build/configure-apk-splits.html

This is a step-by-step how-to from Google.

from liquidcore.

ericwlange avatar ericwlange commented on May 12, 2024

Update on this: Version 0.3.0 reduces the size of the library by half by removing explicit support for 64-bit architectures (they can use the 32-bit versions without issue), and stripping out the debugging symbols. So the current aar is ~15MB. My goal is to get it under 10MB. I think there several other opportunities for reduction.

from liquidcore.

ericwlange avatar ericwlange commented on May 12, 2024

I was able to squeeze out another ~1.5MB by re-using the built-in Android SQLite implementation, rather than compiling sqlite3.c into the project. The footprint (not rolled into a release yet) is now at 13.3MB. Running out of opportunities for reduction, though.

from liquidcore.

ericwlange avatar ericwlange commented on May 12, 2024

This is resolved in the new release, 0.4.0. To reduce further, be sure to enable ABI splits in your build.gradle.

from liquidcore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.