Android Guides | Samples

Android.Views.Display Class

Provides information about the size and density of a logical display.

See Also: Display

Syntax

[Android.Runtime.Register("android/view/Display", DoNotGenerateAcw=true)]
public class Display : Object

Remarks

Provides information about the size and density of a logical display.

The display area is described in two different ways.

  • The application display area specifies the part of the display that may contain an application window, excluding the system decorations. The application display area may be smaller than the real display area because the system subtracts the space needed for decor elements such as the status bar. Use the following methods to query the application display area: Display.GetSize(Point), Display.GetRectSize(Rect) and Display.GetMetrics(DisplayMetrics).
  • The real display area specifies the part of the display that contains content including the system decorations. Even so, the real display area may be smaller than the physical size of the display if the window manager is emulating a smaller display using (adb shell am display-size). Use the following methods to query the real display area: Display.GetRealSize(Point), Display.GetRealMetrics(DisplayMetrics).

A logical display does not necessarily represent a particular physical display device such as the built-in screen or an external monitor. The contents of a logical display may be presented on one or more physical displays according to the devices that are currently attached and whether mirroring has been enabled.

[Android Documentation]

Requirements

Namespace: Android.Views
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Android.Views.Display are listed below.

See Also: Object

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Fields

const
DefaultDisplayInt32 (0). The default Display id, which is the id of the built-in primary display assuming there is one.
const
FlagPresentationDisplayFlags (8). Display flag: Indicates that the display is a presentation display.
const
FlagPrivateDisplayFlags (4). Display flag: Indicates that the display is private.
const
FlagSecureDisplayFlags (2). Display flag: Indicates that the display has a secure video output and supports compositing secure surfaces.
const
FlagSupportsProtectedBuffersDisplayFlags (1). Display flag: Indicates that the display supports compositing content that is stored in protected graphics buffers.
const
StateDozingInt32 (3).

Public Properties

[read-only]
AppVsyncOffsetNanosInt64. Gets the app VSYNC offset, in nanoseconds.
[read-only]
DisplayIdInt32. Gets the display id.
[read-only]
FlagsDisplayFlags. Returns a combination of flags that describe the capabilities of the display.
[read-only]
HeightInt32.
[read-only]
IsValidBoolean. Returns true if this display is still valid, false if the display has been removed.
[read-only]
NameString. Gets the name of the display.
[read-only]
OrientationInt32.
[read-only]
PixelFormatFormat. Gets the pixel format of the display.
[read-only]
PresentationDeadlineNanosInt64. This is how far in advance a buffer must be queued for presentation at a given time.
[read-only]
RefreshRateSingle. Gets the refresh rate of this display in frames per second.
[read-only]
RotationSurfaceOrientation. Returns the rotation of the screen from its "natural" orientation.
[read-only]
StateDisplayState. Gets the state of the display, such as whether it is on or off.
[read-only]
WidthInt32.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

GetCurrentSizeRange(Point, Point)
Return the range of display sizes an application can expect to encounter under normal operation, as long as there is no physical change in screen size.
GetMetrics(DisplayMetrics)
Gets display metrics that describe the size and density of this display.
GetRealMetrics(DisplayMetrics)
Gets display metrics based on the real size of this display.
GetRealSize(Point)
Gets the real size of the display without subtracting any window decor or applying any compatibility scale factors.
GetRectSize(Rect)
Gets the size of the display as a rectangle, in pixels.
GetSize(Point)
Gets the size of the display, in pixels.
GetSupportedRefreshRates() : Single[]
Get the supported refresh rates of this display in frames per second.