admin管理员组文章数量:1565367
本文以android6.0作为基本的版本
穿感器管理的代码位于:
frameworks/base/core/java/android/hardware/Sensor.java
/** 加速度
* A constant describing an accelerometer sensor type.
* <p>See {@link android.hardware.SensorEvent#values SensorEvent.values}
* for more details.
*/
public static final int TYPE_ACCELEROMETER = 1;
/**
* A constant string describing an accelerometer sensor type.
*
* @see #TYPE_ACCELEROMETER
*/
public static final String STRING_TYPE_ACCELEROMETER = "android.sensor.accelerometer";
/**磁力
* A constant describing a magnetic field sensor type.
* <p>See {@link android.hardware.SensorEvent#values SensorEvent.values}
* for more details.
*/
public static final int TYPE_MAGNETIC_FIELD = 2;
/**
* A constant string describing a magnetic field sensor type.
*
* @see #TYPE_MAGNETIC_FIELD
*/
public static final String STRING_TYPE_MAGNETIC_FIELD = "android.sensor.magnetic_field";
/**方向
* A constant describing an orientation sensor type.
* <p>See {@link android.hardware.SensorEvent#values SensorEvent.values}
* for more details.
*
* @deprecated use {@link android.hardware.SensorManager#getOrientation
* SensorManager.getOrientation()} instead.
*/
@Deprecated
public static final int TYPE_ORIENTATION = 3;
/**
* A constant string describing an orientation sensor type.
*
* @see #TYPE_ORIENTATION
* @deprecated use {@link android.hardware.SensorManager#getOrientation
* SensorManager.getOrientation()} instead.
*/
@Deprecated
public static final String STRING_TYPE_ORIENTATION = "android.sensor.orientation";
/**陀螺仪
* A constant describing a gyroscope sensor type.
* <p>See {@link android.hardware.SensorEvent#values SensorEvent.values}
* for more details. */
public static final int TYPE_GYROSCOPE = 4;
/**
* A constant string describing a gyroscope sensor type.
*
* @see #TYPE_GYROSCOPE
*/
public static final String STRING_TYPE_GYROSCOPE = "android.sensor.gyroscope";
/**光线感应
* A constant describing a light sensor type.
* <p>See {@link android.hardware.SensorEvent#values SensorEvent.values}
* for more details.
*/
public static final int TYPE_LIGHT = 5;
/**
* A constant string describing a light sensor type.
*
* @see #TYPE_LIGHT
*/
public static final String STRING_TYPE_LIGHT = "android.sensor.light";
/**压力
* A constant describing a pressure sensor type.
* <p>See {@link android.hardware.SensorEvent#values SensorEvent.values}
* for more details.
*/
public static final int TYPE_PRESSURE = 6;
/**
* A constant string describing a pressure sensor type.
*
* @see #TYPE_PRESSURE
*/
public static final String STRING_TYPE_PRESSURE = "android.sensor.pressure";
/**温度
* A constant describing a temperature sensor type
*
* @deprecated use
* {@link android.hardware.Sensor#TYPE_AMBIENT_TEMPERATURE
* Sensor.TYPE_AMBIENT_TEMPERATURE} instead.
*/
@Deprecated
public static final int TYPE_TEMPERATURE = 7;
/**
* A constant string describing a temperature sensor type
*
* @see #TYPE_TEMPERATURE
* @deprecated use
* {@link android.hardware.Sensor#STRING_TYPE_AMBIENT_TEMPERATURE
* Sensor.STRING_TYPE_AMBIENT_TEMPERATURE} instead.
*/
@Deprecated
public static final String STRING_TYPE_TEMPERATURE = "android.sensor.temperature";
/**接近
* A constant describing a proximity sensor type. This is a wake up sensor.
* <p>See {@link android.hardware.SensorEvent#values SensorEvent.values}
* for more details.
* @see #isWakeUpSensor()
*/
public static final int TYPE_PROXIMITY = 8;
/**
* A constant string describing a proximity sensor type.
*
* @see #TYPE_PROXIMITY
*/
public static final String STRING_TYPE_PROXIMITY = "android.sensor.proximity";
/**重力
* A constant describing a gravity sensor type.
* <p>See {@link android.hardware.SensorEvent#values SensorEvent.values}
* for more details.
*/
public static f
版权声明:本文标题:android sensor 安卓传感器 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1725722371a1038533.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论