android-sensors

Check and enable Magnetic sensor calibration in Android

我只是一个虾纸丫 提交于 2019-12-02 15:19:25
问题 I'm using Magnetic Sensor calibration in my Android app to implement Augmented reality. When the app is used for a long time, the sensor calibration is reduced gradually. Is there any way to check the calibration and automatically enable or prompt the user to perform manual calibration again? 回答1: Unfortunately for an AR type app I can't see how you can know if the magnetic sensor is correctly calibrated or not. Since there are lots of things which can cause the magnetic sensors to go out of

Check and enable Magnetic sensor calibration in Android

二次信任 提交于 2019-12-02 12:14:03
I'm using Magnetic Sensor calibration in my Android app to implement Augmented reality. When the app is used for a long time, the sensor calibration is reduced gradually. Is there any way to check the calibration and automatically enable or prompt the user to perform manual calibration again? Morrison Chang Unfortunately for an AR type app I can't see how you can know if the magnetic sensor is correctly calibrated or not. Since there are lots of things which can cause the magnetic sensors to go out of alignment (see: https://stackoverflow.com/a/9583998/295004 ) one thing that a map/navigation

How to check accuracy values on OnAccuracyChanged method in sensor event listening Activity?

泪湿孤枕 提交于 2019-12-02 11:59:09
I'm making an application that works as a compass, though I want to calibrate the accelerometer and the magneticfield sensors to make it more efficient. From the API I understand that this is possible, and that there are some values that you can check, for example: SENSOR_STATUS_ACCURACY_HIGH How can I achieve this value? I was thinking inside OnAccuracyChanged , but don't know how! The OnAccuracyChanged method of your listener is invoked by system, when a sensor begins to report with different accuracy - this is something you receive from the sensor, so you can not set it. SensorManager API

Timestamp from Android device in the format hh:mm:ss:SS

喜欢而已 提交于 2019-12-02 09:25:00
I have a requirement to log the sensor data in Android. In order to store the values in a Database, I need the timestamp as primary key in the format - hh:mm:ss:SS, where SS represents millisecond value. When I tried to use SensorEvent.timestamp(using the code below), I was unable to get the millisecond from Date class. long currTimeRelativeToBoot = SystemClock.uptimeMillis(); long currTimeAbsolute = System.currentTimeMillis(); double mStartTimeAbsoluteS = ((double)(currTimeAbsolute - currTimeRelativeToBoot))/(double)1000.0; double temp = mStartTimeAbsoluteS+((double)event.timestamp)

Android SensorManager error in LogCat

南笙酒味 提交于 2019-12-01 22:53:00
问题 I have a problem with the sensor manager and errors in the logcat. When I register the listener with this line : sensorMgr.registerListener(this, sensorMgr.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_NORMAL); I recieve theses lines in the logcat with three errors. 06-07 20:52:42.419: D/SensorManager(9215): ====>>>>>Num Sensor: 1 06-07 20:52:42.419: D/SensorManager(9215): ====>>>>>Num Sensor: 2 06-07 20:52:42.419: D/SensorManager(9215): ====>>>>>Num Sensor: 3 06-07

Android SensorManager error in LogCat

丶灬走出姿态 提交于 2019-12-01 21:01:54
I have a problem with the sensor manager and errors in the logcat. When I register the listener with this line : sensorMgr.registerListener(this, sensorMgr.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_NORMAL); I recieve theses lines in the logcat with three errors. 06-07 20:52:42.419: D/SensorManager(9215): ====>>>>>Num Sensor: 1 06-07 20:52:42.419: D/SensorManager(9215): ====>>>>>Num Sensor: 2 06-07 20:52:42.419: D/SensorManager(9215): ====>>>>>Num Sensor: 3 06-07 20:52:42.419: D/SensorManager(9215): ====>>>>>Num Sensor: 4 06-07 20:52:42.419: D/SensorManager(9215):

onAccuracyChanged, why?

旧时模样 提交于 2019-12-01 20:41:02
问题 this is one of the auto-generated functions I get when implementing SensorEventListener i've searched and didn't find anymore than this description: "Do something if sensor accuracy changes." when and how does the proximity sensor accuracy changes ? and in what way can this be useful on my apps ? 回答1: According to my understanding, OnAccuracyChanged method is invoked whenever a sensor reports with different accuracy and onSensorChanged method is called whenever a sensor reports a new value. I

onAccuracyChanged, why?

梦想的初衷 提交于 2019-12-01 19:02:05
this is one of the auto-generated functions I get when implementing SensorEventListener i've searched and didn't find anymore than this description: "Do something if sensor accuracy changes." when and how does the proximity sensor accuracy changes ? and in what way can this be useful on my apps ? driftking9987 According to my understanding, OnAccuracyChanged method is invoked whenever a sensor reports with different accuracy and onSensorChanged method is called whenever a sensor reports a new value. I too had the same question, as in how to make use of onAccuracyChanged method. Let's say you

Gyroscope included in getOrientation?

一世执手 提交于 2019-12-01 13:39:20
I am trying to understand Android sensor management. Am I right that if I want the gyroscope to be included getting the phone orientation, it is automatically done when I call getOrientation(..) and the phone has an gyroscope sensor? So if the phone got acceleration and gyroscope sensor there will probably be a better orientation result, in contrast to the case when it has only acceleration sensors? Thanks! The methods included in the Android APIs to get the orientation does not include readings from the gyroscope sensor. Gyroscope does not provide information about orientation, since it only

Multiple sensors on an android application

浪尽此生 提交于 2019-12-01 12:22:51
I am currently developing an android application that uses multiple sensors, I have used mSensor= mySensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); in OnCreate Method to get the sensor and tv.setText("X: "+ sensorEvent.values[0] + ...); in onSensorChanged method, to display the accelerometer values in a text view. How can I add more sensors and display their values in the same way? How will the program know which sensor I am referring to when I say sensorEvent.values[0] ? Thank you for any help in advance, Maja You will need to check if the sensor values are of that type of sensor