Get Android OS Version

  1. Home
  2. chevron_right
  3. Snippets
  4. chevron_right
  5. Get Android OS Version

If you ever need to get the version of the OS on which your app runs, you can try this out:

android.os.Build.VERSION.SDK_INT

And you can use it against(for more check this out):

android.os.Build.VERSION_CODES.[BASE-KITKAT]

 

Finally you end up with something like:

if(android.os.Build.VERSION.SDK_INT == android.os.Build.VERSION_CODES.HONEYCOMB){
// do whatever you want here
}
Menu