Accelerometer

public final class Accelerometer
extends Object

java.lang.Object
   ↳ androidx.car.app.hardware.info.Accelerometer


Information about car specific accelerometers available from the car hardware.

Summary

Public constructors

Accelerometer(CarValue<List<Float>> forces)

Creates an Accelerometer with the given raw data.

Public methods

boolean equals(Object other)
CarValue<List<Float>> getForces()

Returns the raw accelerometer force data from the car sensor.

int hashCode()
String toString()

Inherited methods

Public constructors

Accelerometer

public Accelerometer (CarValue<List<Float>> forces)

Creates an Accelerometer with the given raw data.

Parameters
forces CarValue

Throws
NullPointerException if forces is null

Public methods

equals

public boolean equals (Object other)

Parameters
other Object

Returns
boolean

getForces

public CarValue<List<Float>> getForces ()

Returns the raw accelerometer force data from the car sensor.

Individual values can be Float.Nan if not reported. The array values consist of:

  • [0]: Acceleration including gravity on the x-axis
  • [1]: Acceleration including gravity on the y-axis
  • [2]: Acceleration including gravity on the z-axis

Returns
CarValue<List<Float>>

hashCode

public int hashCode ()

Returns
int

toString

public String toString ()

Returns
String