sensor

Which Android phones out there do have a gyroscope? [closed]

醉酒当歌 提交于 2019-11-27 00:27:58
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . I find it very hard to get any consolidating information about which Android phones do have a gyroscope, or if there are Android phones with this sensor at all. I read about some (especially Samsung) phone models that have at least a 6-axis accelerometer, but I also read that this is different to a real

How to detect movement of an android device?

我怕爱的太早我们不能终老 提交于 2019-11-26 22:33:29
问题 I need suggestion about how to detect the amount of movement of an android device. Suppose I have put the phone on a table or bed and then if somebody taps the table or sits or laydown on the bed then I want to detect the movement of the android device. Actually I know that android has motion sensors APIs but I don't know which sensor to use and what sensor type is best for this type of movement detection. I would be glad if someone can share some basic demo code. 回答1: Definitely work with

Convert magnetic field X, Y, Z values from device into global reference frame

China☆狼群 提交于 2019-11-26 17:43:57
When you use TYPE_MAGNETOMETER sensor, you get X, Y, Z values of magnetic field strength in relation to the device orientation. What I want to get is to convert these values into global reference frame, clarifying: user takes the device, measure these values, than rotate the device for some degrees around any axis and gets ~the same values. Please, find similar questions below: Getting magnetic field values in global coordinates How can I get the magnetic field vector, independent of the device rotation? In this answer sample solution is described (it is for linear acceleration, but I think it

Android TYPE_LINEAR_ACCELERATION sensor - what does it show?

寵の児 提交于 2019-11-26 17:25:00
I am developing application for car acceleration tracking. I used standard accelerometer, calibrating it in specific position beforehand. Then, assuming phone's orientation is not changing, I logged the accelerometer data for a specified time and calculated move parameters, one of which is the car's speed at the end of the test. It works rather well, on a straight, horizontal road: error of a few percent. But then I found out, that in API-level 10 there is a virtual sensor called TYPE_LINEAR_ACCELERATION and, as far as I understand, it must do what I need: filter gravity, orientation changes -

How should I calculate azimuth, pitch, orientation when my Android device isn't flat?

孤街醉人 提交于 2019-11-26 10:55:07
问题 I\'m using the Android gravity and magnetic field sensors to calculate orientation via SensorManager.getRotationMatrix and SensorManager.getOrientation. This gives me the azimuth, pitch and orientation numbers. The results look sensible when the device is lying flat on a table. However, I\'ve disabled switches between portrait and landscape in the manifest, so that getWindowManager().getDefaultDisplay().getRotation() is always zero. When I rotate the device by 90 degrees so that it\'s

Android accelerometer not working when screen is turned off

廉价感情. 提交于 2019-11-26 10:17:10
问题 I\'m developing an application for my final thesis on computer science, and I need to collect and log accelerometer data. I need to acquire it for a whole day long, so there are serious battery constraints (for instance, I cannot leave the screen on). Also, this isn\'t a market targeted application, so it is pretty acceptable to do some serious hacking, even low level C/C++ coding, if required. It is well known that on many devices the listeners for accelerometer events stop generating events

how to calculate phone's movement in the vertical direction from rest?

为君一笑 提交于 2019-11-26 09:57:33
问题 I am developing an app using android OS for which I need to know how can I calculate the movement of the device up in the vertical direction. For example, the device is at rest (point A), the user picks it up in his hand (point B), now there is a height change between point A and point B, how would i calculate that? I have already gone through the articles about sensors and accelerometers, but I couldn\'t really find anything to help me with that. Anyone have any ideas? 回答1: If you integrate

Get temperature of battery on android

爱⌒轻易说出口 提交于 2019-11-26 09:34:00
问题 How do I get the temperature of the battery in android? 回答1: Try this: private class mBatInfoReceiver extends BroadcastReceiver{ int temp = 0; float get_temp(){ return (float)(temp / 10); } @Override public void onReceive(Context arg0, Intent intent) { temp = intent.getIntExtra(BatteryManager.EXTRA_TEMPERATURE,0); } }; then define in your Variable declarations: private mBatInfoReceiver myBatInfoReceiver; and in onCreate: @Override public void onCreate(Bundle b) { super.onCreate(b);

Convert magnetic field X, Y, Z values from device into global reference frame

不打扰是莪最后的温柔 提交于 2019-11-26 06:01:53
问题 When you use TYPE_MAGNETOMETER sensor, you get X, Y, Z values of magnetic field strength in relation to the device orientation. What I want to get is to convert these values into global reference frame, clarifying: user takes the device, measure these values, than rotate the device for some degrees around any axis and gets ~the same values. Please, find similar questions below: Getting magnetic field values in global coordinates How can I get the magnetic field vector, independent of the

Android - Acceleration down (smash)

拟墨画扇 提交于 2019-11-26 05:35:17
问题 Video explaining for those who does not understand THIS ANSWER IS NOT CORRECTLY ANSWERED PLEASE TRY TO ANSWER IT WITH ANOTHER SOLUTION (100 Bounty is out of date) Same question but better explained This questions was accepted as a correct but it is not at all, I tried it with my old device ZTE and it worked most of time, but now I have a Samsung Galazy A5 2016 and it doesn\'t work, neither on a LG G3. The thing is trying using Accelerometer and some Sensors I have to be able to detect any of