AI2 Component  (Version nb184)
SdkLevel.java
Go to the documentation of this file.
1 // -*- mode: java; c-basic-offset: 2; -*-
2 // Copyright 2009-2011 Google, All Rights reserved
3 // Copyright 2011-2020 MIT, All rights reserved
4 // Released under the Apache License, Version 2.0
5 // http://www.apache.org/licenses/LICENSE-2.0
6 
7 package com.google.appinventor.components.runtime.util;
8 
9 import android.os.Build;
10 
19 public class SdkLevel {
20  public static final int LEVEL_CUPCAKE = 3; // a.k.a. 1.5
21  public static final int LEVEL_DONUT = 4; // a.k.a. 1.6
22  public static final int LEVEL_ECLAIR = 5; // a.k.a. 2.0
23  public static final int LEVEL_ECLAIR_0_1 = 6; // a.k.a. 2.0.1
24  public static final int LEVEL_ECLAIR_MR1 = 7; // a.k.a. 2.1
25  public static final int LEVEL_FROYO = 8; // a.k.a. 2.2
26  public static final int LEVEL_GINGERBREAD = 9; // a.k.a. 2.3
27  public static final int LEVEL_GINGERBREAD_MR1 = 10; // a.k.a. 2.3.3
28  public static final int LEVEL_HONEYCOMB = 11; // a.k.a. 3.0.X
29  public static final int LEVEL_HONEYCOMB_MR1 = 12; // a.k.a. 3.1.X
30  public static final int LEVEL_ICE_CREAM_SANDWICH = 14; // a.k.a. 4.0
31  public static final int LEVEL_JELLYBEAN = 16; // a.k.a. 4.1
32  public static final int LEVEL_JELLYBEAN_MR1 = 17; // a.k.a. 4.2
33  public static final int LEVEL_JELLYBEAN_MR2 = 18; // a.k.a. 4.3
34  public static final int LEVEL_KITKAT = 19; // a.k.a. 4.4
35  public static final int LEVEL_LOLLIPOP = 21; // a.k.a. 5.0
36  public static final int LEVEL_MARSHMALLOW = 23; // a.k.a. 6.0
37  public static final int LEVEL_NOUGAT = 24; // a.k.a. 7.0
38 
39  private SdkLevel() {
40  }
41 
45  public static int getLevel() {
46  // Determine the SDK version in a way that is compatible with API level 3.
47  return Integer.parseInt(Build.VERSION.SDK);
48  }
49 }
com.google.appinventor.components.runtime.util.SdkLevel.LEVEL_LOLLIPOP
static final int LEVEL_LOLLIPOP
Definition: SdkLevel.java:35
com.google.appinventor.components.runtime.util.SdkLevel.LEVEL_GINGERBREAD
static final int LEVEL_GINGERBREAD
Definition: SdkLevel.java:26
com.google.appinventor.components.runtime.util.SdkLevel.LEVEL_KITKAT
static final int LEVEL_KITKAT
Definition: SdkLevel.java:34
com.google.appinventor.components.runtime.util.SdkLevel.LEVEL_ECLAIR_0_1
static final int LEVEL_ECLAIR_0_1
Definition: SdkLevel.java:23
com.google.appinventor.components.runtime.util.SdkLevel.LEVEL_JELLYBEAN_MR2
static final int LEVEL_JELLYBEAN_MR2
Definition: SdkLevel.java:33
com.google.appinventor.components.runtime.util.SdkLevel.LEVEL_NOUGAT
static final int LEVEL_NOUGAT
Definition: SdkLevel.java:37
com.google.appinventor.components.runtime.util.SdkLevel.LEVEL_ECLAIR
static final int LEVEL_ECLAIR
Definition: SdkLevel.java:22
com.google.appinventor.components.runtime.util.SdkLevel.LEVEL_CUPCAKE
static final int LEVEL_CUPCAKE
Definition: SdkLevel.java:20
com.google.appinventor.components.runtime.util.SdkLevel.LEVEL_DONUT
static final int LEVEL_DONUT
Definition: SdkLevel.java:21
com.google.appinventor.components.runtime.util.SdkLevel.LEVEL_HONEYCOMB
static final int LEVEL_HONEYCOMB
Definition: SdkLevel.java:28
com.google.appinventor.components.runtime.util.SdkLevel
Definition: SdkLevel.java:19
com.google.appinventor.components.runtime.util.SdkLevel.LEVEL_MARSHMALLOW
static final int LEVEL_MARSHMALLOW
Definition: SdkLevel.java:36
com.google.appinventor.components.runtime.util.SdkLevel.LEVEL_JELLYBEAN_MR1
static final int LEVEL_JELLYBEAN_MR1
Definition: SdkLevel.java:32
com.google.appinventor.components.runtime.util.SdkLevel.LEVEL_ICE_CREAM_SANDWICH
static final int LEVEL_ICE_CREAM_SANDWICH
Definition: SdkLevel.java:30
com.google.appinventor.components.runtime.util.SdkLevel.LEVEL_JELLYBEAN
static final int LEVEL_JELLYBEAN
Definition: SdkLevel.java:31
com.google.appinventor.components.runtime.util.SdkLevel.getLevel
static int getLevel()
Definition: SdkLevel.java:45
com.google.appinventor.components.runtime.util.SdkLevel.LEVEL_FROYO
static final int LEVEL_FROYO
Definition: SdkLevel.java:25
com.google.appinventor.components.runtime.util.SdkLevel.LEVEL_GINGERBREAD_MR1
static final int LEVEL_GINGERBREAD_MR1
Definition: SdkLevel.java:27
com.google.appinventor.components.runtime.util.SdkLevel.LEVEL_HONEYCOMB_MR1
static final int LEVEL_HONEYCOMB_MR1
Definition: SdkLevel.java:29
com.google.appinventor.components.runtime.util.SdkLevel.LEVEL_ECLAIR_MR1
static final int LEVEL_ECLAIR_MR1
Definition: SdkLevel.java:24