4

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){...do something..}

unable to find N.how to check build version greater than android N

Bharat Kumar Emani
  • 3,436
  • 3
  • 16
  • 30

4 Answers4

5
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){
// perform Opertaion
}

This Must Work. Enjoy.

Akshat Vajpayee
  • 274
  • 1
  • 3
  • 15
2

if(Build.VERSION.SDK_INT >= 24){...do something..}

maybe this works

2
Code name   Version     API level
Oreo        8.0         API level 26
Nougat      7.1         API level 25
Nougat      7.0         API level 24

You should check Build.VERSION.SDK_INT >= Build.VERSION_CODES.N

The “O” version is a provisional API level that is usable only for development and testing during the Android O Developer Preview.

IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
0

the solution is I am using an app (build.gradle) build-tools version "23.0.3" so I was unable to find N and I changed to 25.0.1 and it was working fine.

the minimum build tool version required for N is 24.

Bharat Kumar Emani
  • 3,436
  • 3
  • 16
  • 30