How can I check the system version of Android?

Does anyone know how can I check the system version (e.g. 1.0, 2.2, etc.) programatically?

14 s
14

Example how to use it:

if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD) {
     // only for gingerbread and newer versions
}

Leave a Comment