Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
SDK Extensions
Stay organized with collections
Save and categorize content based on your preferences.
The SDK Extensions module decides the extension SDK level of the device and
provides APIs for apps to query the extension SDK level. This module is
updatable, meaning it can receive updates to functionality outside of the normal
Android release cycle.
SDK Extensions is responsible for:
- Deciding the extension SDK level of the device.
- Providing APIs for apps to query the extension SDK level.
- (Starting Android 12) Determining the values for the
BOOTCLASSPATH
, DEX2OATBOOTCLASSPATH
, and
SYSTEMSERVERCLASSPATH
environment variables.
The SDK Extensions module (com.android.sdkext
) is in
APEX format and is available for devices
running Android 11 or higher.
The SDK Extensions module (com.google.android.sdkext
) is in
APEX format and
contains the following components:
(Starting Android 12) bin/derive_classpath
: A
native binary that runs early in the device boot
process. It reads individual classpath configs files from the system and
other modules, merges them, and defines the definition of CLASSPATH
environment variables.
bin/derive_sdk
: A native binary that runs early in the device boot process
and reads metadata of other modules to set system properties related to the
extension SDK (for example, build.version.extensions.r
).
javalib/framework-sdkextension.jar
: This file is on the bootclasspath that
exposes APIs to apps to query the extension SDK level.
Derive extension SDK level
The derive_sdk
program reads metadata stored as binary protobuf files in the
etc/sdkinfo.binarypb
subpath inside each APEX module. For details on protobuf
structure, refer to the
protobuf
file.
Read extension SDK level
The SDK Extensions module exposes an
SdkExtensions
java class in the android.os.ext
package. Use the getExtensionVersion(int)
method to read the version of an SDK extension (for example,
getExtensionVersion(Build.VERSION_CODES.R)
).
Derive classpaths
The derive_classpath
service reads and merges individual config files in
/system/etc/classpaths/
and /apex/*/etc/classpaths/
. Each config stores
protobuf message from classpaths.proto
in a proto binary format. The exact merging algorithm that determines the order
of the classpath entries is described in
derive_classpath.cpp
and might change over time.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-06-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-18 UTC."],[],[],null,["# SDK Extensions\n\nThe SDK Extensions module decides the extension SDK level of the device and\nprovides APIs for apps to query the extension SDK level. This module is\nupdatable, meaning it can receive updates to functionality outside of the normal\nAndroid release cycle.\n\nSDK Extensions is responsible for:\n\n- Deciding the extension SDK level of the device.\n- Providing APIs for apps to query the extension SDK level.\n- (Starting Android 12) Determining the values for the `BOOTCLASSPATH`, `DEX2OATBOOTCLASSPATH`, and `SYSTEMSERVERCLASSPATH` environment variables.\n\nModule format\n-------------\n\nThe SDK Extensions module (`com.android.sdkext`) is in\n[APEX](/docs/core/ota/apex) format and is available for devices\nrunning Android 11 or higher.\n\nPackage format\n--------------\n\nThe SDK Extensions module (`com.google.android.sdkext`) is in\n[APEX](/devices/tech/ota/apex) format and\ncontains the following components:\n\n- (Starting Android 12) `bin/derive_classpath`: A\n native binary that runs early in the device boot\n process. It reads individual classpath configs files from the system and\n other modules, merges them, and defines the definition of `CLASSPATH`\n environment variables.\n\n- `bin/derive_sdk`: A native binary that runs early in the device boot process\n and reads metadata of other modules to set system properties related to the\n extension SDK (for example, `build.version.extensions.r`).\n\n- `javalib/framework-sdkextension.jar`: This file is on the bootclasspath that\n exposes APIs to apps to query the extension SDK level.\n\nDerive extension SDK level\n--------------------------\n\nThe `derive_sdk` program reads metadata stored as binary protobuf files in the\n`etc/sdkinfo.binarypb` subpath inside each APEX module. For details on protobuf\nstructure, refer to the\n[`protobuf`](https://android.googlesource.com/platform/external/protobuf.git)\nfile.\n\nRead extension SDK level\n------------------------\n\nThe SDK Extensions module exposes an\n[`SdkExtensions`](https://android.googlesource.com/platform/packages/modules/SdkExtensions/)\njava class in the `android.os.ext` package. Use the `getExtensionVersion(int)`\nmethod to read the version of an SDK extension (for example,\n`getExtensionVersion(Build.VERSION_CODES.R)`).\n\nDerive classpaths\n-----------------\n\nThe `derive_classpath` service reads and merges individual config files in\n`/system/etc/classpaths/` and `/apex/*/etc/classpaths/`. Each config stores\nprotobuf message from [`classpaths.proto`](https://android.googlesource.com/platform/packages/modules/common/+/android16-release/proto/classpaths.proto)\nin a proto binary format. The exact merging algorithm that determines the order\nof the classpath entries is described in\n[`derive_classpath.cpp`](https://android.googlesource.com/platform/packages/modules/SdkExtensions/+/android16-release/derive_classpath/derive_classpath.cpp)\nand might change over time."]]