[ Web Proxy ]
URL:
Viewing: https://docs.unity3d.com/ScriptReference/AndroidSdkVersions.html [Back]  [Original]

Unity - Scripting API: AndroidSdkVersions
Version: Unity 6.5 (6000.5)
    • Supported
    • Legacy
    LanguageEnglish
    • C#

    AndroidSdkVersions

    enumeration

    Suggest a change

    Success!

    Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

    Close

    Submission failed

    For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

    Close
    Your name Your email Suggestion* Submit suggestion

    Cancel

    Description

    The Android API levels to specify in scripts.

    Note: The lowest API level listed here strictly corresponds to the lowest supported API level. However, do not use these values to determine the highest supported API level.

    The following code example demonstrates how you can set the target API level using this enum.

    using UnityEngine;
    using UnityEditor;
    using UnityEditor.Build;

    public class AndroidSdkVersionSample : MonoBehaviour { [MenuItem("Build/AndroidSdkVersion Sample")] public static void BuildAndroidSdkVersionSample() { PlayerSettings.SetScriptingBackend(NamedBuildTarget.Android, ScriptingImplementation.IL2CPP); PlayerSettings.Android.targetArchitectures = AndroidArchitecture.ARM64;

    // Set the targetSdkversion to API level 36 using AndroidSdkVersions enum PlayerSettings.Android.targetSdkVersion = AndroidSdkVersions.AndroidApiLevel36;

    BuildPlayerOptions options = new BuildPlayerOptions(); options.scenes = new[] { "Assets/Scenes/SampleScene.unity" }; options.locationPathName = "Build/AndroidBuild.apk"; options.target = BuildTarget.Android; options.targetGroup = BuildTargetGroup.Android; BuildPipeline.BuildPlayer(options); } }

    Properties

    Property Description
    AndroidApiLevelAutoSets the target API level automatically, according to the latest installed SDK on your computer.
    AndroidApiLevel26Android 8.0, "Oreo", API level 26.
    AndroidApiLevel27Android 8.1, "Oreo", API level 27.
    AndroidApiLevel28Android 9.0, "Pie", API level 28.
    AndroidApiLevel29Android 10.0, API level 29.
    AndroidApiLevel30Android 11.0, API level 30.
    AndroidApiLevel31Android 12, API level 31.
    AndroidApiLevel32Android 12L, API level 32.
    AndroidApiLevel33Android 13, API level 33.
    AndroidApiLevel34Android 14, API level 34.
    AndroidApiLevel35Android 15.0, API level 35.
    AndroidApiLevel36Android 16.0, API level 36.
    AndroidApiLevel37Android 17.0, API level 37.0.

    Web Proxy Viewer  |  New URL  |  Original Page