Is it possible to detect if an user is running Android N?
I have a Nexus 6 with the Android N Developer Preview. If I try to get the build version with Build.VERSI
Build.VERSI
I would recommend using Integer value for checking Android version rather than String
public boolean isAndroidN() { return Build.VERSION.SDK_INT == Build.VERSION_CODES.N; }
Just remember it's necessary to have compileSdkVersion to 24 or higher in manifests.xml:
compileSdkVersion 24