-1

I have an App which senses motion of a Device and raise alarm if device is moved. Currently i'm using Accelerometer. But i couldn't fine tune it. Even a small movement causes the alarm to raise.

So my question is which Sensor will suit most for the task ? And what other work arounds are available ?

Please help guys..


Sorry for the lame question, I thought i could get some answers about development experiences of others in this same issue,

Anyway, here's what i did,

I used this code in this Answer

Guess the problem was with the filtering of the sensor data, my method was simply to convert the floats to ints so that decimal part would be truncated.. but it didn't work.. but the code in the link above worked better with some minor changes..

Thanks for your suggestions..

Community
  • 1
  • 1
Dreamer
  • 481
  • 1
  • 5
  • 16
  • GPS or accelerometer. GPS would give you absolute location, but its going to be a problem indoors. Otherwise accelerometer and you'll need to filter the events- what you'll want to do is establish a baseline level of acceleration and only trigger if that baseline is exceeded. – Gabe Sechan Jul 17 '13 at 18:56
  • 3
    The developers guide has an entire article devoted to highlighting the available [motion sensors](http://developer.android.com/guide/topics/sensors/sensors_motion.html). Which one is best is up to you. If you want to make the acceleration work, post some code that doesn't work, outline what is not working, and describe the expected result.. – Bryan Herbst Jul 17 '13 at 18:57
  • maybe you should have a bigger episilon for your movement detection, because the accelerometer would changing constantly even if the device is just on the table. – corgichu Jul 17 '13 at 18:57

1 Answers1

0

Just use the gyroscope. If anyone moves the device they will be sure to tilt it slightly.

Check the gyro for any dramatic changes.

http://developer.android.com/guide/topics/sensors/sensors_motion.html#sensors-motion-gyro

thmas
  • 142
  • 12