if (Build.VERSION.SDK_INT > Build.VERSION_CODES.GINGERBREAD) {
//--incompatible code--
} else {
//--compatible code--
}
The condition runs into incompatible code on Gingerbread. Does Build.VERSION.SDK_INT represents actual device version ? or the SDK version the app has been compiled with ?
This is a static member, which was assigned value when the app first executes.
The SystemProperties.getInt() member function runs on your target device and is not determined when you compile your application.
According to the official guide you should use >= instead of > when detect api version, i.e.
since there may be minor versions between major versions.