public class

AppRTCProximitySensor

extends Object
implements SensorEventListener
java.lang.Object
   ↳ com.nexmo.sdk.conversation.client.audio.AppRTCProximitySensor

Class Overview

AppRTCProximitySensor manages functions related to the proximity sensor in the AppRTC demo. On most device, the proximity sensor is implemented as a boolean-sensor. It returns just two values "NEAR" or "FAR". Thresholding is done on the LUX value i.e. the LUX value of the light sensor is compared with a threshold. A LUX-value more than the threshold means the proximity sensor returns "FAR". Anything less than the threshold value and the sensor returns "NEAR".

Summary

Public Methods
final void onAccuracyChanged(Sensor sensor, int accuracy)
final void onSensorChanged(SensorEvent event)
boolean sensorReportsNearState()
Getter for last reported state.
boolean start()
Activate the proximity sensor.
void stop()
Deactivate the proximity sensor.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.hardware.SensorEventListener

Public Methods

public final void onAccuracyChanged (Sensor sensor, int accuracy)

public final void onSensorChanged (SensorEvent event)

public boolean sensorReportsNearState ()

Getter for last reported state. Set to true if "near" is reported.

public boolean start ()

Activate the proximity sensor. Also do initialization if called for the first time.

public void stop ()

Deactivate the proximity sensor.