Android version code sdk

Русские Блоги

Таблица номеров версий Android-SDK

Предисловие

Поскольку часто бывает необходимо адаптировать версию SDK по-другому, необходимо знать номер версии SDK. Здесь для удобства дальнейшего просмотра запишите его в виде стол. Просто запишите4.0В конце концов, указанная выше версия Android4.0Вышеуказанный уровень проникновения достиг97.4%

1. Таблица версий SDK

На основе Android 6.0 (уровень API 23)

Дата выхода API Level Версия Android VERSION_CODES английское имя китайское имя
2011.10 14 4.0 ICE_CREAM_SANDWICH IceCreamSandwich Сэндвич с мороженым
2011.12 15 4.0.3 ICE_CREAM_SANDWICH_MR1 IceCreamSandwich Сэндвич с мороженым
2012.06 16 4.1 JELLY_BEAN Jelly Bean жевательные конфеты
2012.11 17 4.2 JELLY_BEAN_MR1 Jelly Bean жевательные конфеты
2013.07 18 4.3 JELLY_BEAN_MR2 Jelly Bean жевательные конфеты
2014.06 19 4.4 KITKAT KitKat KitKat Шоколад
2014.09 20 4.4W KITKAT_WATCH KitKat Wear Устройство KitKat для ношения шоколада
2014.11 21 5.0 L или LOLLIPOP Lollipop Леденец
2015.03 22 5.1 LOLLIPOP_MR1 Lollipop Леденец
2015.10 23 6.0 M Marshmallow сахарная вата
Не опубликовано 24 6.X N Nougat Нуга

Если вам нужна более подробная версия NDK, см. Здесь:Форма SDK с версией NDK

2. Назначение номера версии SDK

2.1. Получите номер версии
  • Зачем нужен номер версии
    Иногда в опубликованном приложении бывают исключения. Мы перехватываем исключение и должны загрузить номер версии SDK для устройства, которое передает исключение, на сервер, чтобы разработчик мог проанализировать исключение.
  • Как получить номер версии выпуска и уровень API
2.2. Адаптировать под номер версии
  • Ситуация 1. Система разрешений Android 6.0:

Судите, есть ли разрешение, если версия больше 5.1, ее нужно судить (то есть 6.0 или выше), а другие судить не нужно. Build.VERSION.SDK_INT относится к уровню API текущего устройства.

  • Ситуация 2. Некоторые атрибуты уведомления:

Подзаголовок уведомления требует использования API уровня 16.

Источник

Build.VERSION_CODES

Class Overview

Enumeration of the currently known SDK version codes. These are the values that can be found in SDK . Version numbers increment monotonically with each official platform release.

Summary

Constants
int BASE October 2008: The original, first, version of Android.
int BASE_1_1 February 2009: First Android update, officially called 1.1.
int CUPCAKE May 2009: Android 1.5.
int CUR_DEVELOPMENT Magic version number for a current development build, which has not yet turned into an official release.
int DONUT September 2009: Android 1.6.
int ECLAIR November 2009: Android 2.0

Applications targeting this or a later release will get these new changes in behavior:

    The Service.onStartCommand function will return the new START_STICKY behavior instead of the old compatibility START_STICKY_COMPATIBILITY . int ECLAIR_0_1 December 2009: Android 2.0.1 int ECLAIR_MR1 January 2010: Android 2.1 int FROYO June 2010: Android 2.2 int GINGERBREAD November 2010: Android 2.3

Applications targeting this or a later release will get these new changes in behavior:

    The application’s notification icons will be shown on the new dark status bar background, so must be visible in this situation. int GINGERBREAD_MR1 February 2011: Android 2.3.3. int HONEYCOMB February 2011: Android 3.0. int HONEYCOMB_MR1 May 2011: Android 3.1. int HONEYCOMB_MR2 June 2011: Android 3.2. int ICE_CREAM_SANDWICH October 2011: Android 4.0. int ICE_CREAM_SANDWICH_MR1 December 2011: Android 4.0.3. int JELLY_BEAN June 2012: Android 4.1. int JELLY_BEAN_MR1 November 2012: Android 4.2, Moar jelly beans!

Applications targeting this or a later release will get these new changes in behavior:

    Content Providers: The default value of android:exported is now false . int JELLY_BEAN_MR2 July 2013: Android 4.3, the revenge of the beans. int KITKAT October 2013: Android 4.4, KitKat, another tasty treat. int KITKAT_WATCH Android 4.4W: KitKat for watches, snacks on the run. int LOLLIPOP Lollipop. int LOLLIPOP_MR1 Lollipop with an extra sugar coating on the outside! int M M comes after L.
    Public Constructors
    [Expand]

    Constants

    public static final int BASE

    October 2008: The original, first, version of Android. Yay!

    public static final int BASE_1_1

    February 2009: First Android update, officially called 1.1.

    public static final int CUPCAKE

    May 2009: Android 1.5.

    public static final int CUR_DEVELOPMENT

    Magic version number for a current development build, which has not yet turned into an official release.

    public static final int DONUT

    September 2009: Android 1.6.

    Applications targeting this or a later release will get these new changes in behavior:

    • They must explicitly request the WRITE_EXTERNAL_STORAGE permission to be able to modify the contents of the SD card. (Apps targeting earlier versions will always request the permission.)
    • They must explicitly request the READ_PHONE_STATE permission to be able to be able to retrieve phone state info. (Apps targeting earlier versions will always request the permission.)
    • They are assumed to support different screen densities and sizes. (Apps targeting earlier versions are assumed to only support medium density normal size screens unless otherwise indicated). They can still explicitly specify screen support either way with the supports-screens manifest tag.
    • TabHost will use the new dark tab background design.

    public static final int ECLAIR

    November 2009: Android 2.0

    Applications targeting this or a later release will get these new changes in behavior:

    • The Service.onStartCommand function will return the new START_STICKY behavior instead of the old compatibility START_STICKY_COMPATIBILITY .
    • The Activity class will now execute back key presses on the key up instead of key down, to be able to detect canceled presses from virtual keys.
    • The TabWidget class will use a new color scheme for tabs. In the new scheme, the foreground tab has a medium gray background the background tabs have a dark gray background.

    public static final int ECLAIR_0_1

    December 2009: Android 2.0.1

    public static final int ECLAIR_MR1

    January 2010: Android 2.1

    public static final int FROYO

    June 2010: Android 2.2

    public static final int GINGERBREAD

    November 2010: Android 2.3

    Applications targeting this or a later release will get these new changes in behavior:

    • The application’s notification icons will be shown on the new dark status bar background, so must be visible in this situation.

    public static final int GINGERBREAD_MR1

    February 2011: Android 2.3.3.

    public static final int HONEYCOMB

    February 2011: Android 3.0.

    Applications targeting this or a later release will get these new changes in behavior:

    • The default theme for applications is now dark holographic: Theme_Holo .
    • On large screen devices that do not have a physical menu button, the soft (compatibility) menu is disabled.
    • The activity lifecycle has changed slightly as per Activity .
    • An application will crash if it does not call through to the super implementation of its Activity.onPause() method.
    • When an application requires a permission to access one of its components (activity, receiver, service, provider), this permission is no longer enforced when the application wants to access its own component. This means it can require a permission on a component that it does not itself hold and still access that component.
    • Context.getSharedPreferences() will not automatically reload the preferences if they have changed on storage, unless MODE_MULTI_PROCESS is used.
    • setMotionEventSplittingEnabled(boolean) will default to true.
    • FLAG_SPLIT_TOUCH is enabled by default on windows.
    • PopupWindow.isSplitTouchEnabled() will return true by default.
    • GridView and ListView will use View.setActivated for selected items if they do not implement Checkable .
    • Scroller will be constructed with «flywheel» behavior enabled by default.

    public static final int HONEYCOMB_MR1

    May 2011: Android 3.1.

    public static final int HONEYCOMB_MR2

    June 2011: Android 3.2.

    Update to Honeycomb MR1 to support 7 inch tablets, improve screen compatibility mode, etc.

    As of this version, applications that don’t say whether they support XLARGE screens will be assumed to do so only if they target HONEYCOMB or later; it had been GINGERBREAD or later. Applications that don’t support a screen size at least as large as the current screen will provide the user with a UI to switch them in to screen size compatibility mode.

    This version introduces new screen size resource qualifiers based on the screen size in dp: see screenWidthDp , screenHeightDp , and smallestScreenWidthDp . Supplying these in as per requiresSmallestWidthDp , compatibleWidthLimitDp , and largestWidthLimitDp is preferred over the older screen size buckets and for older devices the appropriate buckets will be inferred from them.

    Applications targeting this or a later release will get these new changes in behavior:

    New FEATURE_SCREEN_PORTRAIT and FEATURE_SCREEN_LANDSCAPE features were introduced in this release. Applications that target previous platform versions are assumed to require both portrait and landscape support in the device; when targeting Honeycomb MR1 or greater the application is responsible for specifying any specific orientation it requires.

    AsyncTask will use the serial executor by default when calling execute(Params. ) .

    ActivityInfo.configChanges will have the CONFIG_SCREEN_SIZE and CONFIG_SMALLEST_SCREEN_SIZE bits set; these need to be cleared for older applications because some developers have done absolute comparisons against this value instead of correctly masking the bits they are interested in.

    public static final int ICE_CREAM_SANDWICH

    October 2011: Android 4.0.

    Applications targeting this or a later release will get these new changes in behavior:

    • For devices without a dedicated menu key, the software compatibility menu key will not be shown even on phones. By targeting Ice Cream Sandwich or later, your UI must always have its own menu UI affordance if needed, on both tablets and phones. The ActionBar will take care of this for you.
    • 2d drawing hardware acceleration is now turned on by default. You can use android:hardwareAccelerated to turn it off if needed, although this is strongly discouraged since it will result in poor performance on larger screen devices.
    • The default theme for applications is now the «device default» theme: Theme_DeviceDefault . This may be the holo dark theme or a different dark theme defined by the specific device. The Theme_Holo family must not be modified for a device to be considered compatible. Applications that explicitly request a theme from the Holo family will be guaranteed that these themes will not change character within the same platform version. Applications that wish to blend in with the device should use a theme from the Theme_DeviceDefault family.
    • Managed cursors can now throw an exception if you directly close the cursor yourself without stopping the management of it; previously failures would be silently ignored.
    • The fadingEdge attribute on views will be ignored (fading edges is no longer a standard part of the UI). A new requiresFadingEdge attribute allows applications to still force fading edges on for special cases.
    • Context.bindService() will not automatically add in BIND_WAIVE_PRIORITY .
    • App Widgets will have standard padding automatically added around them, rather than relying on the padding being baked into the widget itself.
    • An exception will be thrown if you try to change the type of a window after it has been added to the window manager. Previously this would result in random incorrect behavior.
    • AnimationSet will parse out the duration, fillBefore, fillAfter, repeatMode, and startOffset XML attributes that are defined.
    • ActionBar.setHomeButtonEnabled() is false by default.

    public static final int ICE_CREAM_SANDWICH_MR1

    December 2011: Android 4.0.3.

    public static final int JELLY_BEAN

    June 2012: Android 4.1.

    Applications targeting this or a later release will get these new changes in behavior:

    • You must explicitly request the READ_CALL_LOG and/or WRITE_CALL_LOG permissions; access to the call log is no longer implicitly provided through READ_CONTACTS and WRITE_CONTACTS .
    • RemoteViews will throw an exception if setting an onClick handler for views being generated by a RemoteViewsService for a collection container; previously this just resulted in a warning log message.
    • New ActionBar policy for embedded tabs: embedded tabs are now always stacked in the action bar when in portrait mode, regardless of the size of the screen.
    • WebSettings.setAllowFileAccessFromFileURLs and WebSettings.setAllowUniversalAccessFromFileURLs default to false.
    • Calls to PackageManager.setComponentEnabledSetting will now throw an IllegalArgumentException if the given component class name does not exist in the application’s manifest.
    • NfcAdapter.setNdefPushMessage , NfcAdapter.setNdefPushMessageCallback and NfcAdapter.setOnNdefPushCompleteCallback will throw IllegalStateException if called after the Activity has been destroyed.
    • Accessibility services must require the new BIND_ACCESSIBILITY_SERVICE permission or they will not be available for use.
    • AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS must be set for unimportant views to be included in queries.

    public static final int JELLY_BEAN_MR1

    November 2012: Android 4.2, Moar jelly beans!

    Applications targeting this or a later release will get these new changes in behavior:

    • Content Providers: The default value of android:exported is now false . See the android:exported section in the provider documentation for more details.
    • View.getLayoutDirection() can return different values than LAYOUT_DIRECTION_LTR based on the locale etc.
    • WebView.addJavascriptInterface requires explicit annotations on methods for them to be accessible from Javascript.

    public static final int JELLY_BEAN_MR2

    July 2013: Android 4.3, the revenge of the beans.

    public static final int KITKAT

    October 2013: Android 4.4, KitKat, another tasty treat.

    Applications targeting this or a later release will get these new changes in behavior:

    • The default result of PreferenceActivity.isValueFragment becomes false instead of true.
    • In WebView , apps targeting earlier versions will have JS URLs evaluated directly and any result of the evaluation will not replace the current page content. Apps targetting KITKAT or later that load a JS URL will have the result of that URL replace the content of the current page
    • AlarmManager.set becomes interpreted as an inexact value, to give the system more flexibility in scheduling alarms.
    • Context.getSharedPreferences no longer allows a null name.
    • RelativeLayout changes to compute wrapped content margins correctly.
    • ActionBar ‘s window content overlay is allowed to be drawn.
    • The READ_EXTERNAL_STORAGE permission is now always enforced.
    • Access to package-specific external storage directories belonging to the calling app no longer requires the READ_EXTERNAL_STORAGE or WRITE_EXTERNAL_STORAGE permissions.

    public static final int KITKAT_WATCH

    Android 4.4W: KitKat for watches, snacks on the run.

    Applications targeting this or a later release will get these new changes in behavior:

    • AlertDialog might not have a default background if the theme does not specify one.

    public static final int LOLLIPOP

    Lollipop. A flat one with beautiful shadows. But still tasty.

    Applications targeting this or a later release will get these new changes in behavior:

    Источник

    Читайте также:  Mvvm livedata android пример
    Оцените статью