Detect device up-down movement using sensors - android

I am trying to detect if the user is moving the device in a diagonal motion (like a sword move). Even if it is vertical move then fine. I just need to know that he moved it from top to bottom. I am exploring sensors (mainly accelerator, gyroscope and linear accelerometer).
I can't seem to figure out how to do the detection. Any working example out there? or Pointer?
Thank you

Related

CardBoard: In 360 video, how can I use both gesture and device movement together?

I have been stuck on this issue for a week.
Currently, I'm able to control it with gesture using Matrix4.setLookAt() function. I'm able to control it by moving around the device.
However, I tried to combined both gesture and device movement together. When I swipe up/down, the gesture will start to move the screen at an angle (down and left, up and right). Here is the video demonstration:
youtube link
I'm new to camera matrix. Can anyone give me advice on this?
Thanks

Sensor for detect moving with device

Hi I make app in which I use camera and I need to detect in which side is phone moving (left,rigth,up or down) all sensor I have tried just return moving around axis.
So If I have camera and I will move phone to right/left/up/down how to detect it?
You can you the linear accelerometer to detect which direction the user is moving. This page has all the details you will need. There a few sample projects you can have a look at as well.
http://developer.android.com/guide/topics/sensors/sensors_motion.html#sensors-motion-accel

Detect Android device movement on Plain Surface

I am creating a project in Android.
This have pre-requirement is : Play video By moving Android device.
I have implemented Accelerometer Sensor, but if I move device on Plain surface and move device Up, Down, Left or Right, then No Event is called. It is only detects when device rotates in any direction.
Is it possible to detect moving device on plain surface??
Thanks in Advance.

Move image smoothly according to the movement of a device

So, here is the deal. I want to create a little game-like app(let me call it the game, from now on). Before I begin, I'd like to show you up the raw UI of the game.
So, as you can see, I would have:
a red ball in the middle
two walls on either sides
Procedure:
User would move the device to right side and hits the right wall (the gray ball on the right side is simulated)
Movement of device occures to left so it can reach the left wall as well. (like the gray ball on the left)
All I know regarding the program side is the sensors, especially Accelerometers. Most of the people at Stackoverflow are of the opinion that working with sensors not on its good stages, that is, the data comes from them is very noisy, processing them can be hard. However, I think a lot of games are using them to some extent...
Well, I tried moving an image by drawing it. I attempted to get data from gyroscope, accelerometer, linear accelerometer and used that data to draw my image. The problem is that if I move the device smoothly and slowly then I got almost no movement on the drawings. That gives the horrible user experience.
The question is how can I implement my game so that it can meet all my needs above even if I move my device slowly. Any approaches are welcome.

Move OpenGL ES objects with accelerometer

I'm developing an Android application. I want to do the following:
I will have a black screen with an object in its center, for example, a vase.
With this app, I will a 360 degrees view of vase. I explain: imagine the vase is the center of an imaginary circle. I want to make user follow this circle, to see the vase from any point of view. I don't know if I explain it well.
In real life, you can move around a vase and see it in front, behind, and other sides. I want to simulate this.
My problem is that I'm not sure if I can simulate this using accelerometer.
Who can I know if user is describing a circle with the mobile phone?
If you don't understand me or you need more details, please tell me.
You should combine accelerometer with compass. Compass gives you direction.

Categories

Resources