SensorManager class

SensorManager lets you access the device's sensors.

See: https://developer.android.com/reference/android/hardware/SensorManager

Constructors

SensorManager()

Properties

hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited

Static Methods

getDefaultSensor(int type) → Future<Sensor>
Gets the default sensor for a given type. [...]
registerListener(Sensor sensor, { int samplingPeriodUs int maxReportLatencyUs }) → Future<EventChannel>
Registers a SensorEvent listener for the given sensor at the given sampling frequency and the given maximum reporting latency. [...]

Constants

AXIS_MINUS_X → const int
see remapCoordinateSystem. [...]
129
AXIS_MINUS_Y → const int
see remapCoordinateSystem. [...]
130
AXIS_MINUS_Z → const int
see remapCoordinateSystem. [...]
131
AXIS_X → const int
see remapCoordinateSystem. [...]
1
AXIS_Y → const int
see remapCoordinateSystem. [...]
2
AXIS_Z → const int
see remapCoordinateSystem. [...]
3
GRAVITY_DEATH_STAR_I → const double
Gravity (estimate) on the first Death Star in Empire units (m/s^2). [...]
3.53036145e-07
GRAVITY_EARTH → const double
Earth's gravity in SI units (m/s^2). [...]
9.80665
GRAVITY_JUPITER → const double
Jupiter's gravity in SI units (m/s^2). [...]
23.12
GRAVITY_MARS → const double
Mars' gravity in SI units (m/s^2). [...]
3.71
GRAVITY_MERCURY → const double
Mercury's gravity in SI units (m/s^2). [...]
3.7
GRAVITY_MOON → const double
The Moon's gravity in SI units (m/s^2). [...]
1.6
GRAVITY_NEPTUNE → const double
Neptune's gravity in SI units (m/s^2). [...]
11.0
GRAVITY_PLUTO → const double
Pluto's gravity in SI units (m/s^2). [...]
0.6
GRAVITY_SATURN → const double
Saturn's gravity in SI units (m/s^2). [...]
8.96
GRAVITY_SUN → const double
Sun's gravity in SI units (m/s^2). [...]
275.0
GRAVITY_THE_ISLAND → const double
Gravity on the island. [...]
4.815162342
GRAVITY_URANUS → const double
Uranus' gravity in SI units (m/s^2). [...]
8.69
GRAVITY_VENUS → const double
Venus' gravity in SI units (m/s^2). [...]
8.87
LIGHT_CLOUDY → const double
luminance under a cloudy sky in lux. [...]
100.0
LIGHT_FULLMOON → const double
luminance at night with full moon in lux. [...]
0.25
LIGHT_NO_MOON → const double
luminance at night with no moon in lux. [...]
0.001
LIGHT_OVERCAST → const double
luminance under an overcast sky in lux. [...]
10000.0
LIGHT_SHADE → const double
luminance in shade in lux. [...]
20000.0
LIGHT_SUNLIGHT → const double
luminance of sunlight in lux. [...]
110000.0
LIGHT_SUNLIGHT_MAX → const double
Maximum luminance of sunlight in lux. [...]
120000.0
LIGHT_SUNRISE → const double
luminance at sunrise in lux. [...]
400.0
MAGNETIC_FIELD_EARTH_MAX → const double
Maximum magnetic field on Earth's surface. [...]
60.0
MAGNETIC_FIELD_EARTH_MIN → const double
Minimum magnetic field on Earth's surface. [...]
30.0
PRESSURE_STANDARD_ATMOSPHERE → const double
Standard atmosphere, or average sea-level pressure in hPa (millibar). [...]
1013.25
SENSOR_DELAY_FASTEST → const int
get sensor data as fast as possible. [...]
0
SENSOR_DELAY_GAME → const int
rate suitable for games. [...]
1
SENSOR_DELAY_NORMAL → const int
rate (default) suitable for screen orientation changes. [...]
3
SENSOR_DELAY_UI → const int
rate suitable for the user interface. [...]
2
SENSOR_STATUS_ACCURACY_HIGH → const int
This sensor is reporting data with maximum accuracy. [...]
3
SENSOR_STATUS_ACCURACY_LOW → const int
This sensor is reporting data with low accuracy, calibration with the environment is needed. [...]
1
SENSOR_STATUS_ACCURACY_MEDIUM → const int
This sensor is reporting data with an average level of accuracy, calibration with the environment may improve the readings. [...]
2
SENSOR_STATUS_NO_CONTACT → const int
The values returned by this sensor cannot be trusted because the sensor had no contact with what it was measuring (for example, the heart rate monitor is not in contact with the user). [...]
-1
SENSOR_STATUS_UNRELIABLE → const int
The values returned by this sensor cannot be trusted, calibration is needed or the environment doesn't allow readings. [...]
0
STANDARD_GRAVITY → const double
Standard gravity (g) on Earth. [...]
9.80665