Android includes facilities that automatically adjust application assets and UI layouts appropriately for the device to ensure that third-party applications run well on a variety of hardware configurations. On the Android-compatible display(s) where all third-party Android-compatible applications can run, device implementations MUST properly implement these APIs and behaviors, as detailed in this section.
The units referenced by the requirements in this section are defined as follows:
The Android UI framework supports a variety of different logical screen layout sizes, and allows applications to query the current configuration's screen layout size via Configuration.screenLayout
with the SCREENLAYOUT_SIZE_MASK
and Configuration.smallestScreenWidthDp
.
Device implementations:
[C-0-1] MUST report the correct layout size for the Configuration.screenLayout
as defined in the Android SDK documentation. Specifically, device implementations MUST report the correct logical density-independent pixel (dp) screen dimensions as below:
Configuration.uiMode
set as any value other than UI_MODE_TYPE_WATCH, and reporting a small
size for the Configuration.screenLayout
, MUST have at least 426 dp x 320 dp.normal
size for the Configuration.screenLayout
, MUST have at least 480 dp x 320 dp.large
size for the Configuration.screenLayout
, MUST have at least 640 dp x 480 dp.xlarge
size for the Configuration.screenLayout
, MUST have at least 960 dp x 720 dp.[C-0-2] MUST correctly honor applications' stated support for screen sizes through the <supports-screens
> attribute in the AndroidManifest.xml, as described in the Android SDK documentation.
MAY have the Android-compatible display(s) with rounded corners.
If device implementations support UI_MODE_TYPE_NORMAL
and include Android-compatible display(s) with rounded corners, they:
[C-1-1] MUST ensure that at least one of the following requirements is met:
The radius of the rounded corners is less than or equal to 38 dp.
When a 15 dp by 15 dp box is anchored at each corner of the logical display, at least one pixel of each box is visible on the screen.
SHOULD include user affordance to switch to the display mode with the rectangular corners.
If device implementations include an Android-compatible display(s) that is foldable, or includes a folding hinge between multiple display panels and makes such display(s) available to render third-party apps, they:
If device implementations include an Android-compatible display(s) that is foldable, or includes a folding hinge between multiple display panels and if the hinge or fold crosses a fullscreen application window, they:
For details on correctly implementing the sidecar or extension APIs refer to the public documentation of Window Manager Jetpack.
While there is no restriction to the aspect ratio of the physical display for the Android-compatible display(s), the aspect ratio of the logical display where third-party apps are rendered, which can be derived from the height and width values reported through the view.Display
APIs and Configuration APIs, MUST meet the following requirements:
[C-0-1] Device implementations with Configuration.uiMode
set to UI_MODE_TYPE_NORMAL
MUST have an aspect ratio value less than or equal to 1.86 (roughly 16:9), unless the app meets one of the following conditions:
android.max_aspect
metadata value.android:maxAspectRatio
that would restrict the allowed aspect ratio.[C-0-2] Device implementations with Configuration.uiMode
set to UI_MODE_TYPE_NORMAL
MUST have an aspect ratio value equal to or greater than 1.3333 (4:3), unless the app can be stretched wider by meeting one of the following conditions:
android:minAspectRatio
that would restrict the allowed aspect ratio.[C-0-3] Device implementations with the Configuration.uiMode
set as UI_MODE_TYPE_WATCH
MUST have an aspect ratio value set as 1.0 (1:1).
The Android UI framework defines a set of standard logical densities to help application developers target application resources.
* 120 dpi (ldpi) * 140 dpi (140dpi) * 160 dpi (mdpi) * 180 dpi (180dpi) * 200 dpi (200dpi) * 213 dpi (tvdpi) * 220 dpi (220dpi) * 240 dpi (hdpi) * 260 dpi (260dpi) * 280 dpi (280dpi) * 300 dpi (300dpi) * 320 dpi (xhdpi) * 340 dpi (340dpi) * 360 dpi (360dpi) * 400 dpi (400dpi) * 420 dpi (420dpi) * 480 dpi (xxhdpi) * 560 dpi (560dpi) * 640 dpi (xxxhdpi)
If there is an affordance to change the display size of the device:
If device implementations include the Android-compatible display(s) or video output to the Android-compatible display screen(s), they:
android.util.DisplayMetrics
API.If device implementations does not include an embedded screen or video output, they:
android.util.DisplayMetrics
API for the emulated default view.Display
.Device implementations:
android.hardware.screen.portrait
and/or android.hardware.screen.landscape
) and MUST report at least one supported orientation. For example, a device with a fixed orientation landscape screen, such as a television or laptop, SHOULD only report android.hardware.screen.landscape
.android.content.res.Configuration.orientation
, android.view.Display.getOrientation()
, or other APIs.If device implementations support both screen orientations, they:
Device implementations:
GLES10.getString()
method) and the native APIs.If device implementations include a screen or video output, they:
If device implementations support any of the OpenGL ES versions, they:
EGL_KHR_image
, EGL_KHR_image_base
, EGL_ANDROID_image_native_buffer
, EGL_ANDROID_get_native_client_buffer
, EGL_KHR_wait_sync
, EGL_KHR_get_all_proc_addresses
, EGL_ANDROID_presentation_time
, EGL_KHR_swap_buffers_with_damage
, EGL_ANDROID_recordable
, and EGL_ANDROID_GLES_layers
extensions.EGL_KHR_partial_update
and OES_EGL_image_external
extensions.getString()
method, any texture compression format that they support, which is typically vendor-specific.If device implementations declare support for OpenGL ES 3.0, 3.1, or 3.2, they:
OES_EGL_image_external_essl3
extension.If device implementations support OpenGL ES 3.2, they:
If device implementations support the OpenGL ES Android Extension Pack in its entirety, they:
android.hardware.opengles.aep
feature flag.If device implementations expose support for the EGL_KHR_mutable_render_buffer
extension, they:
EGL_ANDROID_front_buffer_auto_refresh
extension.Android includes support for Vulkan , a low-overhead, cross-platform API for high-performance 3D graphics.
If device implementations support OpenGL ES 3.1, they:
If device implementations include a screen or video output, they:
The Vulkan dEQP tests are partitioned into a number of test lists, each with an associated date/version. These are in the Android source tree at external/deqp/android/cts/master/vk-master-YYYY-MM-DD.txt
. A device that supports Vulkan at a self-reported level indicates that it can pass the dEQP tests in all test lists from this level and earlier.
If device implementations include support for Vulkan 1.0 or higher, they:
android.hardware.vulkan.level
and android.hardware.vulkan.version
feature flags.VkPhysicalDevice
for the Vulkan native API vkEnumeratePhysicalDevices()
.VkPhysicalDevice
.libVkLayer*.so
in the application package’s native library directory, through the Vulkan native APIs vkEnumerateInstanceLayerProperties()
and vkEnumerateDeviceLayerProperties()
.android:debuggable
attribute set as true
.android.software.vulkan.deqp.level
feature flag.132317953
(from Mar 1st, 2019) as reported in the android.software.vulkan.deqp.level
feature flag.132317953
and the version specified in the android.software.vulkan.deqp.level
feature flag.If device implementations do not include support for Vulkan 1.0, they:
android.hardware.vulkan.level
, android.hardware.vulkan.version
).VkPhysicalDevice
for the Vulkan native API vkEnumeratePhysicalDevices()
.If device implementations include support for Vulkan 1.1 and declare any of the Vulkan feature flags, they:
SYNC_FD
external semaphore and handle types and the VK_ANDROID_external_memory_android_hardware_buffer
extension.Android includes a mechanism for applications to declare that they want to enable hardware acceleration for 2D graphics at the Application, Activity, Window, or View level through the use of a manifest tag android:hardwareAccelerated or direct API calls.
Device implementations:
Android includes a TextureView object that lets developers directly integrate hardware-accelerated OpenGL ES textures as rendering targets in a UI hierarchy.
Device implementations:
If device implementations claim support for wide-gamut displays through Configuration.isScreenWideColorGamut()
, they:
EGL_KHR_no_config_context
, EGL_EXT_pixel_format_float
, EGL_KHR_gl_colorspace
, EGL_EXT_gl_colorspace_scrgb
, EGL_EXT_gl_colorspace_scrgb_linear
, EGL_EXT_gl_colorspace_display_p3
, EGL_EXT_gl_colorspace_display_p3_linear
, and EGL_EXT_gl_colorspace_display_p3_passthrough
extensions.GL_EXT_sRGB
.Conversely, if device implementations do not support wide-gamut displays, they:
Android specifies a “compatibility mode” in which the framework operates in a ‘normal’ screen size equivalent (320dp width) mode for the benefit of legacy applications not developed for old versions of Android that pre-date screen-size independence.
The Android platform includes APIs that allow applications to render rich graphics to an Android-compatible display. Devices MUST support all of these APIs as defined by the Android SDK unless specifically allowed in this document.
All of a device implementation's Android-compatible displays:
Android includes support for secondary Android-compatible displays to enable media sharing capabilities and developer APIs for accessing external displays.
If device implementations support an external display either via a wired, wireless, or an embedded additional display connection, they:
DisplayManager
system service and API as described in the Android SDK documentation.