Gravity sensing is mainly used in game development. This effect is very good! It is mainly three axes. It is easy to understand: that is facing up, the value is positive, and the value is down negative! I have tested this effect, because gravity sensing can be realized on the mobile phone, so no. Sorry! Reprinted please indicate the source: http://blog.csdn.net/wdaming1986/article/details/6752232
1. MainActivity. Java code:
Package com. ray. test;
Android acceleration sensor: The implementation of the shake function and android Acceleration
I. Principles:
The shake function in the Android mobile phone is already very common. Recently, I came into contact with this function. The principle is very simple: using an accel
Android location sensor
The Android platform provides two sensors to determine the location of the device. These two sensors are magnetic field sensors and direction sensors. The Android platform also provides a sensor (proximity sensor
data structure is defined in sensor. h,The sensormanager processes only the vector. V, vector. Status, and time fields and distributes them to registered listeners.
For example, the first itemVector. V contains information values in the X, Y, and Z directions, which are registered by javasworientataionlister,After sensormanager obtains these three values, it passes them to worker worientataionlister. The latter code is located:Frameworkd/base/CORE/Ja
The Android mobile phone operating system is an open-source operating system that allows users to flexibly program to meet their various needs. Before learning this system, let's take a look at the Android sensor applications. In the past two days, I have studied Android
ServiceManager.registerlistener (this, sensor, SENSORMANAGER.SENSOR_DELAY_UI);//Register the Sensor service.In the Sensor service registration method, there are three parameters, three parameters are: Monitor sensor event, sensor target type, delay time accuracy density (in
Sensor types:
1. Motion sensor
Acceleration sensors, gravity sensors, and gyroscope (mobile phone attitude judgment)
2. Position Sensor
Direction sensor and Magnetic Sensor
3. Envi
Environmental sensorsThe Android platform provides 4 sensors to detect different external environments. We can use these sensors to detect the surrounding. For example, the humidity, light, air pressure and temperature of the surrounding air can be detected. These 4 sensors are hardware-based sensors. In addition to the light sensor, 3 other sensors are rare in common A
I just followed the video to learn the operation examples of sensors in Android, and made a very simple compass application using the direction sensor... Sensor functions are rarely used in work projects, so many of them don't know. Now I want to learn more about it as a step-by-step approach...
First paste the software for final operation
The image material use
It's a long way to go, not just to survive but to love.This content: Android Gravity sensorFirst,Sensormannager sensor Management Objects1. Get SensormannagerAll the sensors in the phone need to be accessed via Sensormannager, and the Getsystemservice (Sensor_service) method can be used to get the sensor management obj
[] gravity, float[] geomagnetic) * Fill rotation array R * r: Rotating array to fill * I: convert magnetic field data into actual gravity coordinates can be set to NULL by default * Gravity: Accelerometer data * Geomagnetic: Geomagnetic sensor Data*/Sensormanager.getrotationmatrix (R,NULL, Accvalues, magvalues); /*** public static float[] Getorientation (float[] r, float[] values) * R: Rotating Array * Values: Analog direction
Introduction to the concept and principle of pedometer sensorAndroid KitKat have added a few more hardware sensors to it ' s API list. Step sensors is one of them, which looks very promising. Although, not a lot of phones yet has these Step sensors, in the future, this would gradually become a standard I think. Currently, Nexus 5 has them.Step Counter:this keeps a count of the number of steps that is taken. The counter is only reset when you re-boot the device, else, for every step to take (or t
The Android platform provides two sensors to determine the location of the device, and these two sensors are magnetic field sensors and directional sensors. The Android platform also provides sensors (proximity sensors) that measure the distance from the front of a device to a nearby object. magnetic field sensors and proximity sensors are hardware-based sensors. Most A
air pressure data, their relationship of change probably obey the following expressions.Because we want to calculate the altitude (a), so slightly change, you can know the formula of A is as follows.where P is the current atmospheric pressure, P0 is the standard atmospheric pressure. This allows us to get an initial estimate of the altitude by acquiring the value of the built-in barometric pressure sensor on the
1. The positive and negative directions of the X, Y, and Z axes of the accelrator:
When the mobile phone screen is placed horizontally up: (x, y, z) = (0, 0,-10) instead of (0, 0, 10)When the phone is lifted at the top, y decreases and the value is negative.When the mobile phone is lifted at the bottom: Y increases and is positiveWhen the right side of the mobi
*/Private Sensoreventlistener Msensoreventlistener = new Sensoreventlistener () {@Overridepublic void Onsensorchanged (Sensorevent event) {/** sensor Data Changes *//** get the sensing coordinates on the phone in three directions */Float[] values = event.values;float x = values[0];Float y = values[1];float z = values[2];int sensorvalue = 20;if (Math.Abs (x) > Sensorvalue | | Math.Abs (y) > Sensorvalue | |
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.