Proximity

  • Description

      Proximity

      The Proximity Sensor is a non visible component that you can measure the proximity of an object (in cm) with respect to the screen a device's display. the
      This sensor is usually used for determine if a phone is approaching to the ear of a person, is say, allows you to determine how far away it is an object of the device. Many devices return the absolute distance, in cm, but some return only values near and far. In this case, the sensor usually reports the value maximum range in the distant state and the minimum value in the state close. This value is called distance and measures the distance between the object and the device.

  • Events

    • Proximity Changed
    • Event that runs when you change the distance (in cm) of the object device.
  • Properties

    • Distance (number)
    • Allows to obtain the distance from the object to the device in cm
    • Maximum Range (number)
    • Allows to obtain the maximum range of the proximity sensor of the device.
    • Available (boolean)
    • Reports whether the device has a proximity sensor.
    • Enabled (boolean)
    • Allows you to enable or disable the proximity sensor. If you are enabled, the device will listen for changes in the proximity.
    • Keep Running When On Pause (boolean)
    • If set to 'True', it will continue to identify the changes of proximity even when the app is not visible.
  • Example

    • Determine distance
    • We have enabled the sensor in the case that the device has. The to receive changes in the proximity of the screen will display the distance, in cm, between the object and the device.