Automate

Automate

Make your phone or tablet smarter with automation

Get it on Google Play

Display metrics get

A decision block that gets the metrics of a connected display.

If the proceed option is set to Immediately, then get current metrics of the display without pausing the fiber. If set to When changed, then the fiber will pause until display metrics, with an assigned output variable, has changed, or the display is disconnected. The block proceed through the NO path if/when the display is disconnected.

To calculate the dimensions of a display in pixels evaluate bounds[2] - bounds[0] to return its width, and bounds[3] - bounds[1] its height.

Note! This feature requires Android 4.2+.

Options

  • Proceed — when the fiber should proceed.

Input arguments

  • Display id — id of the display to get metrics for, see Display query block, default is id of the primary display.

Output variables

  • Bounds — variable to assign an array with the bounds [left, top, right, bottom] of the display, in pixels.
  • Density — variable to assign density factor used for the display, i.e. multiply with pixels to get dip.
  • Rotation — variable to assign the degrees of rotation of the display.
  • Refresh rate — variable to refresh rate of the display, in hertz.
Note! This documentation is also accessible within the app from Help & feedback menu.