本文整理汇总了Java中android.hardware.SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM属性的典型用法代码示例。如果您正苦于以下问题:Java SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM属性的具体用法?Java SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM怎么用?Java SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.hardware.SensorManager
的用法示例。
在下文中一共展示了SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
@ProtoMethod(description = "Start the light sensor. Returns the intensity. The value per device might vary", example = "")
@ProtoMethodParam(params = {"function(intensity)"})
public void start() {
super.start();
mListener = new SensorEventListener() {
@Override
public void onSensorChanged(SensorEvent event) {
ReturnObject r = new ReturnObject();
r.put("intensity", event.values[0]);
mCallbackLightChange.event(r);
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
switch (accuracy) {
case SensorManager.SENSOR_STATUS_UNRELIABLE:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_LOW:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_HIGH:
break;
}
}
};
isEnabled = mSensormanager.registerListener(mListener, sensor, speed);
}
示例2: start
public void start() {
super.start();
mListener = new SensorEventListener() {
@Override
public void onSensorChanged(SensorEvent event) {
ReturnObject r = new ReturnObject();
r.put("x", event.values[0]);
r.put("y", event.values[1]);
r.put("z", event.values[2]);
mCallback.event(r);
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
switch (accuracy) {
case SensorManager.SENSOR_STATUS_UNRELIABLE:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_LOW:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_HIGH:
break;
}
}
};
isEnabled = mSensormanager.registerListener(mListener, sensor, speed);
}
示例3: start
@ProtoMethod(description = "Start the proximity sensor. Returns a proximity value. It might differ per device", example = "")
@ProtoMethodParam(params = {"function(proximity)"})
public void start() {
super.start();
mListener = new SensorEventListener() {
@Override
public void onSensorChanged(SensorEvent event) {
ReturnObject r = new ReturnObject();
r.put("distance", event.values[0]);
mCallback.event(r);
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
switch (accuracy) {
case SensorManager.SENSOR_STATUS_UNRELIABLE:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_LOW:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_HIGH:
break;
}
}
};
isEnabled = mSensormanager.registerListener(mListener, sensor, speed);
}
示例4: start
public void start() {
super.start();
mListener = new SensorEventListener() {
@Override
public void onSensorChanged(SensorEvent event) {
ReturnObject r = new ReturnObject();
r.put("bar", event.values[0]);
mCallback.event(r);
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
switch (accuracy) {
case SensorManager.SENSOR_STATUS_UNRELIABLE:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_LOW:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_HIGH:
break;
}
}
};
isEnabled = mSensormanager.registerListener(mListener, sensor, speed);
}
示例5: start
@ProtoMethod(description = "Start the orientation sensor. Returns pitch, roll, yaw", example = "")
@ProtoMethodParam(params = {"function(pitch, roll, yaw)"})
public void start() {
super.start();
mListener = new SensorEventListener() {
@Override
public void onSensorChanged(SensorEvent event) {
ReturnObject r = new ReturnObject();
r.put("azimuth", event.values[0]);
r.put("pitch", event.values[1]);
r.put("roll", event.values[2]);
mCallbackOrientationChange.event(r);
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
switch (accuracy) {
case SensorManager.SENSOR_STATUS_UNRELIABLE:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_LOW:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_HIGH:
break;
}
}
};
isEnabled = mSensormanager.registerListener(mListener, sensor, speed);
}
示例6: start
public void start() {
super.start();
mListener = new SensorEventListener() {
@Override
public void onSensorChanged(SensorEvent event) {
if (mCallback != null) {
ReturnObject r = new ReturnObject();
r.put("x", event.values[0]);
r.put("y", event.values[1]);
r.put("z", event.values[2]);
float force = (float) Math.sqrt(Math.pow(event.values[0], 2) + Math.pow(event.values[1], 2) + Math.pow(event.values[2], 2));
r.put("force", force);
mCallback.event(r);
}
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
switch (accuracy) {
case SensorManager.SENSOR_STATUS_UNRELIABLE:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_LOW:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_HIGH:
break;
}
}
};
isEnabled = mSensormanager.registerListener(mListener, sensor, speed);
}
示例7: start
@ProtoMethod(description = "Start the magnetic sensor", example = "")
@ProtoMethodParam(params = {"function(value)"})
public void start() {
super.start();
mListener = new SensorEventListener() {
@Override
public void onSensorChanged(SensorEvent event) {
ReturnObject r = new ReturnObject();
r.put("x", event.values[0]);
r.put("y", event.values[1]);
r.put("z", event.values[2]);
mCallbackMagneticChange.event(r);
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
switch (accuracy) {
case SensorManager.SENSOR_STATUS_UNRELIABLE:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_LOW:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_HIGH:
break;
}
}
};
isEnabled = mSensormanager.registerListener(mListener, sensor, speed);
}
示例8: start
@ProtoMethod(description = "Start the step counter. Not superacurate and only few devices", example = "")
@ProtoMethodParam(params = {"function(value)"})
public void start() {
super.start();
mListener = new SensorEventListener() {
@Override
public void onSensorChanged(SensorEvent event) {
mCallback.event(null);
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
switch (accuracy) {
case SensorManager.SENSOR_STATUS_UNRELIABLE:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_LOW:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM:
break;
case SensorManager.SENSOR_STATUS_ACCURACY_HIGH:
break;
}
}
};
isEnabled = mSensormanager.registerListener(mListener, sensor, speed);
}