| java.lang.Object | |
| ↳ | com.nexmo.sdk.conversation.client.audio.AppRTCProximitySensor |
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".
| 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
| |||||||||||
Getter for last reported state. Set to true if "near" is reported.
Activate the proximity sensor. Also do initialization if called for the first time.
Deactivate the proximity sensor.