For example if was impossible for us to catch a C++ exception and launch a Java exception in JNI. If you have a way to remove them, go for it! Actually, there’s another reason to avoid using C++ exceptions: their support is still far from perfect. Whilst using exceptions and RTTI can help you to use existing code, it will obviously increase your binary size. We actually do not use exceptions in our native lib, but for the sake of completeness, I’ll cover this point too.Ĭ++ exceptions and RTTI are disabled by default but you can enable them via APP_CPPFLAGS in your Application.mk file and use a compatible STL, for example: APP_CPPFLAGS += -fexceptions -frtti devices (x86 coming soon) Build files for embedding native libraries into Android applications Native debugging using ndk-gdb NDK documentation in. The NDK toolchain assumes a 16-byte stack alignment. You can download older unsupported versions of the NDK from the Unsupported. Stopped all x8664 toolchains from adding -mstackrealign by default.
To address this problem we managed to reduce Algolia binary size from 850KB to 307KB. Select the NDK package for your development platform. AVelov is 638KB and Algolia was 850KB, which would mean that AVelov would more than double in size with Algolia Search embedded. We were reminded of the importance of binary size by Cyril Mottier who informed us that it would be difficult to integrate our lib in AVelov Android Application because its size. When we started Algolia Development for Android, binary size optimization was not one of our main concerns. In fact we even started to develop in JAVA before switching to C/C++ for reasons of performance. Android Studio Arctic Fox (2020.3.1) updates Android Studio to version 2020.