Skip to content

Most visited

Recently visited

navigation

UserSensorReading

UserSensorReading

public class UserSensorReading
extends Object

java.lang.Object
   ↳ com.google.android.things.userdriver.UserSensorReading


A single user-sensor reading. Readings consist of an array of floats as well as a sensor status to indicate the confidence level of the given values. The meaning and order of the float array depends on the sensor type, and should match the values provided by SensorEvent.values. Sensor status is not used for all sensor types; those which do not report a status will ignore this value. This class is immutable so that it cannot be modified and reused between multiple readings. This is important because the driver manager may need to store old readings for reference and they must not change.

Summary

Public constructors

UserSensorReading(float[] values)

Creates a new UserSensorReading with a default SENSOR_STATUS_ACCURACY_HIGH status.

UserSensorReading(float[] values, int status)

Creates a new UserSensorReading.

Public methods

boolean equals(Object object)
int hashCode()

Inherited methods

From class java.lang.Object

Public constructors

UserSensorReading

UserSensorReading (float[] values)

Creates a new UserSensorReading with a default SENSOR_STATUS_ACCURACY_HIGH status. The values array is copied here so it may be reused without affecting this object.

Parameters
values float: Sensor reading values.

UserSensorReading

UserSensorReading (float[] values, 
                int status)

Creates a new UserSensorReading. The values array is copied here so it may be reused without affecting this object.

Parameters
values float: Sensor reading values.
status int: A SensorManager.SENSOR_STATUS_* value.

Public methods

equals

boolean equals (Object object)

Parameters
object Object
Returns
boolean

hashCode

int hashCode ()

Returns
int
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)