Getting OS version with NDK in C c++获得版本号
http://stackoverflow.com/questions/19355783/getting-os-version-with-ndk-in-c
#include <cutils/properties.h>
// ...
int myfunction() {
char sdk_ver_str[PROPERTY_VALUE_MAX] = "0";
property_get("ro.build.version.sdk", sdk_ver_str, "0");
sdk_ver = atoi(sdk_ver_str);
// ...
}