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

4
  • 2
    stackoverflow.com/a/36357030/3395198 Commented Aug 24, 2017 at 6:41
  • if(Build.VERSION.SDK_INT >= 24) {...do something..} Commented Aug 24, 2017 at 6:42
  • @IntelliJ Amiya I want to check for greater than N Commented Aug 24, 2017 at 6:46
  • @BharatKumarEmani Re-open your question . Please check given link Commented Aug 24, 2017 at 6:47

4 Answers 4

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

This Must Work. Enjoy.

Sign up to request clarification or add additional context in comments.

Comments

2

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

maybe this works

Comments

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.

Comments

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.

2 Comments

Build.VERSION.SDK_INT >25 ?
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) this was working when i change my buildToolsVersion "25.0.1"

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.