admin管理员组文章数量:1296303
I want to incorporate some Accelerometer code into a Android application im working and want to see if this is possible. Basically what I need is for the code to detect car acceleration motion. I am not wanting to determine speed with the code but just distinguish if the phone is in a car and has accelerated motion (Hence the car is moving for the first time). I have gone through many different accelerometer applications to see if this motion produces a viable profile to go off of and it appears it does. Just looking for something that popups a "Hello World" dialog when it detects your in the car and its moving for the first time down the street. Any help would be appreciated and a simple yes or no its possible would work. I would also be interested in pensating anyone that is capable of doing this as well. I need this done like yesterday so please let me know.
Thank You,
JTW
I want to incorporate some Accelerometer code into a Android application im working and want to see if this is possible. Basically what I need is for the code to detect car acceleration motion. I am not wanting to determine speed with the code but just distinguish if the phone is in a car and has accelerated motion (Hence the car is moving for the first time). I have gone through many different accelerometer applications to see if this motion produces a viable profile to go off of and it appears it does. Just looking for something that popups a "Hello World" dialog when it detects your in the car and its moving for the first time down the street. Any help would be appreciated and a simple yes or no its possible would work. I would also be interested in pensating anyone that is capable of doing this as well. I need this done like yesterday so please let me know.
Thank You,
JTW
Share Improve this question edited Jun 5, 2010 at 19:17 DOK 32.9k8 gold badges63 silver badges93 bronze badges asked Jun 5, 2010 at 17:55 Stud33Stud33 411 silver badge2 bronze badges 7- 4 Make your title more specific. Is this possible could be anything. – Mark Szymanski Commented Jun 5, 2010 at 17:57
- 2 Are you saying that you want to be able to detect that you're moving in a car, as opposed to on foot, bike, train, roller skates, etc? – Jeff Commented Jun 5, 2010 at 18:01
- 3 This smells like "I need to hire a genius programmer, are you interested in solving my domain-specific problem on the fly?" ... – jcolebrand Commented Jun 5, 2010 at 18:01
- 2 Yes, let's get more people focusing on their smartphones while they're driving. – DOK Commented Jun 5, 2010 at 18:05
- 2 Following your title and tags, I must admit that 'this' in java is possible. – Ivan Prodanov Commented Jun 5, 2010 at 18:12
2 Answers
Reset to default 7Basically what I need is for the code to detect car acceleration motion.
As others have noted, there is no such thing as "car acceleration". There is only acceleration. Acceleration, as a concept in physics, can e from everything from a car to the device being shaken.
So, for example, here is some code that detects a device being shaken.
So, the question then bees: can you e up with an acceleration value that is definitively from a car in motion? I suspect the answer is no, for most cars. For example, this site indicates that a 2008 Aston Martin demonstrates an acceleration of 6.5 meters/second^2. The force of gravity is greater (9.8 meters/second^2). My shake code will only register a shake at around 12 meters/second^2 -- less than that, and simple movements will be considered a shake.
As another answer suggests, you are probably better served using GPS.
If, on the other hand, you can supply me with a 2008 Aston Martin for testing, I'd be happy to run some accelerometer experiments... :-)
Yes. If by moving the car, the device moves :P
http://stuffthathappens./blog/2009/03/15/android-accelerometer/
But probably, it would be better to bine it with GPS.
http://www.devx./wireless/Article/43005/1954
本文标签: javaDetect car acceleration in Android appStack Overflow
版权声明:本文标题:java - Detect car acceleration in Android app? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741606027a2387979.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论