Java tutorial
//package com.java2s; import android.os.Build; public class Main { @SuppressWarnings("deprecation") public static int getAndroidSDKVersion() { int version = 0; try { version = Integer.valueOf(Build.VERSION.SDK); } catch (NumberFormatException e) { } return version; } }