android-sensors

Recycling sensors from a broken android device using adb

老子叫甜甜 提交于 2019-12-05 04:52:07
问题 I just broke my s3. 3 years ago it was one of the best smartphones. Question How can I get the values of the inertial sensors of the phone via usb? I would like to use the accelerometer, gyroscope, magnetometer, barometer and gps sensors of the device. Let's say that we want to get: the raw acceleration's data along the three axes. I connected the usb cable and ran adb root and adb shell . Ok. root@android:/ # find / -type d -iname "sensors" /sys/devices/virtual/sensors /sys/class/sensors The

Accelerometer's Min and Max value range and sensor data conversion

拈花ヽ惹草 提交于 2019-12-05 04:45:56
问题 I have moto g 16 GB device from Motorola. It has LIS3DH 3 axis Accelerometer. For reading Max and Min value of Accelerometer i have used this APIs. getMaximumRange() Some says its shows zero to Pick or pick to pick But for my device i get value 39.24 so i though 39.24 / 9.8 = ~4.00 s my range is +/- 4g But when i simply read x,y,z data and store it in file and see the values when giving max acceleration to the my smart phone then its shows values up to 76 m/sec2 What the meaning of this? Is

Drawing in air with Android phone

爷,独闯天下 提交于 2019-12-05 03:21:43
I am working on an application to draw in the air with an android phone. As my phone is moving, thanks to the acceletometer, i retrieve the acceleration on each axis ax, ay, az. What I am interested in is: x,y,z. From what I read in forums and in some tutorials, integrating the accelaration twice gives huge errors. So what is the best solution for me to get information on the deplacement of the phone? Thanks for your help. Ali Not exactly what you are looking for: Store orientation to an array - and compare Tracking orientation works well. Perhaps you can do something similar with the

how to detect this specific movement gesture via sensors?

泪湿孤枕 提交于 2019-12-05 02:28:11
问题 I'm working on an Android project. it's goal is to detect predefined movement gesture of the device. if the device rotates 45 degrees over an axis(X,Y or Z) and then rotates back to its first position( the first and second positions are not going to be accurate, I mean if it was rotated 50 degrees instead of 45, not important !!!)then the gesture has happened and the app should detect it. I tried to do that using Accelerometer and Magnetic sensors of device to continually monitor the

Android: How do I call a method which is existing in other API Level?

浪子不回头ぞ 提交于 2019-12-05 00:12:20
I have application using Android 2.1 which utilize LocationManager to get the altitude. But now, I need to obtain the altitude using SensorManager which requires API Level 9 (2.3). How can I put the SensorManager.getAltitude(float, float) in my 2.1 android application by putting a condition and calling it by a function name (possible in normal Java)? Thank you in advance UPDATE 1 If you have noticed that my application need to be compiled using Android 2.1. That's why I'm looking for a way to call the function by name or in any other way that can be compiled. You can call the method using

Android light sensor not triggering event

前提是你 提交于 2019-12-04 23:39:40
问题 When using the light sensor, I have an issue where the onSensorChanged() event is never triggered. The reason is that when the listener is registered, if the lux value remains constant, there's no change thus no event. However, I still want to know the lux value! There's a difference between a constant lux value of 0, and a constant of 60,000! After some research, I realised that there's no way to directly read the lux value of the sensor. So how do I get the lux value if it's constant, and

How to detect user presence in android?

二次信任 提交于 2019-12-04 20:18:00
问题 I know in Galaxy Samsung SIII it is possible to configure in settings an option to avoid the screen turns off when user is looking into the screen. I think the phone uses the camera or a kind of a sensor of presence. is it possible to do it programmatically? even if yes, some devices won't be capable to do that. I imagine some possibilities here: using the camera, accelerometer, or even user activity: if the screen is on, touches, I don't know. There is a specific library about "user presence

Updating TextView without losing Spinner focus in busy ListView

感情迁移 提交于 2019-12-04 19:32:51
I sample sensors (That's make the ListView busy) with custom user rate and I show the values in my listview, therefore I have a custom listview with 3 textview (for x, y and z values) and one spinner. my layout is: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="fill_parent"> <LinearLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="fill_parent" android:minWidth="140dp"> <TextView android:layout

android - detect downward acceleration, specifically an elevator

点点圈 提交于 2019-12-04 19:14:00
I want to be able to detect a situation where the phone has an acceleration towards the ground (probably means that the Gravity sensor has to be used here also). I have read a lot about this topic in the Android docs, about High and Low pass filters and other posts, and right now what I have is a code sample that gets the acceleration in the X, Y and Z axis after stripping the gravity: if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) { final float alpha = (float) 0.8; gravity[0] = alpha * gravity[0] + (1 - alpha) * event.values[0]; gravity[1] = alpha * gravity[1] + (1 - alpha) * event

Get Euler Yaw angle of an Android Device

僤鯓⒐⒋嵵緔 提交于 2019-12-04 18:35:23
I'm trying to get yaw of an android device expressed in euler angles. To be clear i dont want 'Azimuth' (which is the angle to magnetic north) I want the rotation of the 'z' axis of an android device as shown in this picture. This (IMHO) should be the axis used in some car games to determine the amount of steering. It is my understanding I could just use the Accelerometer values (without the magnetic fields) but I'm unable to get the determined value. (probably due to a lack of understanding of how rotation matrixes works). Can someone point me toward the right direction? Hoan Nguyen If you