IT. Expert System.

Android Reference

OrientationListener


android.view

Class OrientationListener

  • All Implemented Interfaces:
    SensorListener

    Deprecated.
    use OrientationEventListener instead. This class internally uses the OrientationEventListener.

    @Deprecated
    public abstract class OrientationListener
    extends Object
    implements SensorListener
    Helper class for receiving notifications from the SensorManager when the orientation of the device has changed.
    • Field Detail

      • ORIENTATION_UNKNOWN

        public static final int ORIENTATION_UNKNOWN
        Deprecated.
        Returned from onOrientationChanged when the device orientation cannot be determined (typically when the device is in a close to flat position).
        See Also:
        onOrientationChanged(int), Constant Field Values
    • Constructor Detail

      • OrientationListener

        public OrientationListener(Context context)
        Deprecated.
        Creates a new OrientationListener.
        Parameters:
        context - for the OrientationListener.
      • OrientationListener

        public OrientationListener(Context context,
                           int rate)
        Deprecated.
        Creates a new OrientationListener.
        Parameters:
        context - for the OrientationListener.
        rate - at which sensor events are processed (see also SensorManager). Use the default value of SENSOR_DELAY_NORMAL for simple screen orientation change detection.
    • Method Detail

      • enable

        public void enable()
        Deprecated.
        Enables the OrientationListener so it will monitor the sensor and call onOrientationChanged(int) when the device orientation changes.
      • disable

        public void disable()
        Deprecated.
        Disables the OrientationListener.
      • onAccuracyChanged

        public void onAccuracyChanged(int sensor,
                             int accuracy)
        Deprecated.
        Description copied from interface: SensorListener
        Called when the accuracy of a sensor has changed. See SensorManager for details.
        Specified by:
        onAccuracyChanged in interface SensorListener
        Parameters:
        sensor - The ID of the sensor being monitored
        accuracy - The new accuracy of this sensor.
      • onSensorChanged

        public void onSensorChanged(int sensor,
                           float[] values)
        Deprecated.
        Description copied from interface: SensorListener

        Called when sensor values have changed. The length and contents of the values array vary depending on which sensor is being monitored. See SensorManager for details on possible sensor types.

        Definition of the coordinate system used below.

        The X axis refers to the screen's horizontal axis (the small edge in portrait mode, the long edge in landscape mode) and points to the right.

        The Y axis refers to the screen's vertical axis and points towards the top of the screen (the origin is in the lower-left corner).

        The Z axis points toward the sky when the device is lying on its back on a table.

        IMPORTANT NOTE: The axis are swapped when the device's screen orientation changes. To access the unswapped values, use indices 3, 4 and 5 in values[].

        SENSOR_ORIENTATION, SENSOR_ORIENTATION_RAW:

        All values are angles in degrees.

        values[0]: Azimuth, rotation around the Z axis (0<=azimuth<360). 0 = north, 90 = east, 180 = south, 270 = west

        values[1]: Pitch, rotation around X axis (-180<=pitch<=180), with positive values when the z-axis moves toward the y-axis.

        values[2]: Roll, rotation around Y axis (-90<=roll<=90), with positive values when the z-axis moves toward the x-axis.

        Note that this definition of yaw, pitch and roll is different from the traditional definition used in aviation where the X axis is along the long side of the plane (tail to nose).

        SENSOR_ACCELEROMETER:

        All values are in SI units (m/s^2) and measure contact forces.

        values[0]: force applied by the device on the x-axis

        values[1]: force applied by the device on the y-axis

        values[2]: force applied by the device on the z-axis

        Examples:

      • When the device is pushed on its left side toward the right, the x acceleration value is negative (the device applies a reaction force to the push toward the left)
      • When the device lies flat on a table, the acceleration value is -STANDARD_GRAVITY, which correspond to the force the device applies on the table in reaction to gravity.
      • SENSOR_MAGNETIC_FIELD:

        All values are in micro-Tesla (uT) and measure the ambient magnetic field in the X, Y and -Z axis.

        Note: the magnetic field's Z axis is inverted.

Specified by:
onSensorChanged in interface SensorListener
Parameters:
sensor - The ID of the sensor being monitored
values - The new values for the sensor.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 3744 / . Delta: 0.09973 с