3

Here is my Application.mk:

APP_ABI := armeabi-v7a 
APP_PLATFORM := android-16
APP_OPTIM := release
APP_STL := gnustl_static
APP_CPPFLAGS := -std=gnu++11

The value for APP_PLATFORM is android-16 so that we can support Android OS version 4.1 and above.

I know that the app builds fine withAPP_PLATFORMset toandroid-16. It implies that I am not using any Android functionality that is newer thanandroid-16. What if I change it toandroid-19? As I am not using any newer Android functionality, I am thinking the code should still work fine on OS 4.1. Please share your wisdom. Regards.

ph0b
  • 14,353
  • 4
  • 43
  • 41
Peter
  • 11,260
  • 14
  • 78
  • 155

1 Answers1

4

Bionic headers haven't changed between android-16 and android-19 (they changed a lot with android-21), so you may be fine compiling against android-19 and running on android-16 devices.

BUT the NDK platforms aren't supposed to be backward compatible. Compiling against an higher platform than the one your lib will run on isn't right.

All the platforms that are part of the NDK are maintained and bugs are fixed, so there is no reason to build against a higher platform if you're not using new functionalities.

ph0b
  • 14,353
  • 4
  • 43
  • 41
  • 1
    I would add that this breaking change already happened. `signal.h` interface was changed in API 19. Libraries compiled with that won't work on older APIs. – StenSoft May 03 '15 at 14:41