Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

Get excited for the Samsung Galaxy S5! Find everything you need and discuss it in our Galaxy S5 Forum!

test: Reply
 
LinkBack Thread Tools
Old February 20th, 2012, 04:34 PM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Jan 2012
Posts: 4
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Detect Movements on Android Device

Is it possible to detect whether the android device has moved in a certain direction and how much it has moved? For example, if I move my device 100 pixels to the left, a number would be displayed saying x is -100 pixels. If this is possible, which sensor would I use?

user12 is offline  
Reply With Quote
sponsored links
Old February 22nd, 2012, 12:22 AM   #2 (permalink)
Junior Member
 
powerpoint45's Avatar
 
Join Date: Dec 2011
Posts: 58
 
Device(s):
Carrier: Not Provided

Thanks: 23
Thanked 5 Times in 4 Posts
Default

Are u talking about gps
powerpoint45 is online now  
Reply With Quote
Old February 22nd, 2012, 03:45 PM   #3 (permalink)
New Member
Thread Author (OP)
 
Join Date: Jan 2012
Posts: 4
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

No, I'm asking if it is possible to detect much smaller movements, like 6 inches or something.
user12 is offline  
Reply With Quote
Old February 23rd, 2012, 02:54 PM   #4 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,936
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 478 Times in 292 Posts
Default

You could use the accelerometer i suppose as with any movement, there will be some sort of acceleration and deceleration.
jonbonazza is offline  
Reply With Quote
Old February 23rd, 2012, 03:48 PM   #5 (permalink)
New Member
Thread Author (OP)
 
Join Date: Jan 2012
Posts: 4
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Could you please provide an example? I don't know how to use the acceleration to determine the distance the device moved. Thanks.
user12 is offline  
Reply With Quote
Old February 25th, 2012, 09:51 PM   #6 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,936
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 478 Times in 292 Posts
Default

I honestly don't have much experience with the Accelerometer APIs, so I would be learning just as you would be.
jonbonazza is offline  
Reply With Quote
Reply
Tags
detect, detection, motion, move, movement, sensor


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 07:22 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.