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. Devices 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
.
[C-0-1] Device implementations 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] Device implementations 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.
While there is no restriction to the screen aspect ratio value of the physical screen display, the screen aspect ratio of the logical display that third-party apps are rendered within, as can be derived from the height and width values reported through the view.Display
APIs and Configuration API, MUST meet the following requirements:
[C-0-1] Device implementations with the Configuration.uiMode
set as UI_MODE_TYPE_NORMAL
MUST have an aspect ratio value between 1.3333 (4:3) and 1.86 (roughly 16:9), unless the app can be deemed as ready to be stretched longer by meeting 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 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) * 160 dpi (mdpi) * 213 dpi (tvdpi) * 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 a screen or video output, 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
and EGL_ANDROID_recordable
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:
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.0 or 3.1, they:
If device implementations include a screen or video output, they:
Device implementations, if including support for Vulkan 1.0:
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
.Device implementations, if not including support for Vulkan 1.0:
android.hardware.vulkan.level
, android.hardware.vulkan.version
).VkPhysicalDevice
for the Vulkan native API vkEnumeratePhysicalDevices()
.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.
If device implementations claim support for wide-gamut displays through Display.isWideColorGamut()
, they:
EGL_KHR_no_config_context
, EGL_EXT_pixel_format_float
,EGL_KHR_gl_colorspace
, EGL_EXT_colorspace_scrgb_linear
, and EGL_GL_colorspace_display_p3
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 the display. Devices MUST support all of these APIs as defined by the Android SDK unless specifically allowed in this document.
Device implementations:
Android includes support for secondary display 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.