0

I am trying to understand why ndk is supported with only limited .so libraries as documented in http://developer.android.com/ndk/guides/stable_apis.html

Is there any reason why other .so libraries (libhardware, libgui, libservicesensor, etc) which are used by the java framework can't be also used with ndk ?

2
  • 1
    Google is not attempting to maintain binary compatibility for those libraries across Android versions. If you link to libraries outside of the stable list, your app may fail to load on some versions of Android, because symbols that you rely upon do not exist, have been altered, etc. May 13, 2016 at 15:28
  • Both types of libraries are build from c++ files, so what is the meaning of binary compatiliby ? thx.
    – ransh
    May 13, 2016 at 15:45

1 Answer 1

2

Once an API is made public, they can't change it in a way that would affect existing applications that use it, i.e. it can only be extended, not changed. This adds quite a bit of burden to any development around it, and limits in what ways it can be developed. Because of that, one has to carefully decide which APIs they are ready to support publicly, and weigh this against what benefit there would be from making it public.

Since the design of Android is that the main public API is in java, making everything available in the NDK would be a huge duplication. (Even if the lower level components are C/C++, they are not intended to be public, they are only intended to be used by the higher level public API components.) Only a few native APIs have been exposed, in practice, the ones that are necessary to achieve good performance, and some limited parts for convenience.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.