B bluedude Well-Known Member Licensed User Longtime User Dec 20, 2010 #1 Anyone in the mood to create a shake library? Sample in java How to detect shake motion on Android phone | ClingMarks
Anyone in the mood to create a shake library? Sample in java How to detect shake motion on Android phone | ClingMarks
C Cor Active Member Licensed User Longtime User Dec 20, 2010 #2 You can shake the phone without code, i tried it works :sign0060: Upvote 0
S susu Well-Known Member Licensed User Longtime User Dec 20, 2010 #3 B4A supported Sensor already. http://www.b4x.com/forum/basic4android-getting-started-tutorials/6647-orientation-accelerometer.html Upvote 0
B4A supported Sensor already. http://www.b4x.com/forum/basic4android-getting-started-tutorials/6647-orientation-accelerometer.html
B bluedude Well-Known Member Licensed User Longtime User Dec 21, 2010 #4 Shake logic I know I can get to the sensor but does anyone have shake logic? How to detect a shake? Cheers, Upvote 0
Shake logic I know I can get to the sensor but does anyone have shake logic? How to detect a shake? Cheers,
klaus Expert Licensed User Longtime User Dec 22, 2010 #5 Have a look at the attached example, it's an adaptation of the code from your link. You should test it, I can't having no device. Tested a similar code with B4PPC. You should play with the ShakeThreshold variable to adapt the sensivitiy. Using the variables JerkX, JerkY and JerkZ instead of Jerk you could have a test for each direction. Hope this helps. What do you want to do with the result ? Best regards. Attachments Shake.zip Shake.zip 5.8 KB · Views: 655 Last edited: Dec 22, 2010 Upvote 0
Have a look at the attached example, it's an adaptation of the code from your link. You should test it, I can't having no device. Tested a similar code with B4PPC. You should play with the ShakeThreshold variable to adapt the sensivitiy. Using the variables JerkX, JerkY and JerkZ instead of Jerk you could have a test for each direction. Hope this helps. What do you want to do with the result ? Best regards.
C Cor Active Member Licensed User Longtime User Dec 22, 2010 #6 Hello, change Accelorometer to Accelorometer1 Accelorometer.StartListening("Accelorometer1") and ShakeThreshold=150 and it works on real device thanks Code: Sub btnActivate_CheckedChange(Checked As Boolean) Activated=Checked If Activated=True Then Accelorometer.StartListening("Accelorometer1") LastUpdate=DateTime.Now Else Accelorometer.StopListening End If End Sub Upvote 0
Hello, change Accelorometer to Accelorometer1 Accelorometer.StartListening("Accelorometer1") and ShakeThreshold=150 and it works on real device thanks Code: Sub btnActivate_CheckedChange(Checked As Boolean) Activated=Checked If Activated=True Then Accelorometer.StartListening("Accelorometer1") LastUpdate=DateTime.Now Else Accelorometer.StopListening End If End Sub
klaus Expert Licensed User Longtime User Dec 22, 2010 #7 Thanks Cor, The zip file has been updated in post #5. Best regards. Upvote 0
B bluedude Well-Known Member Licensed User Longtime User Dec 22, 2010 #8 Thanks guys I will try it a.s.a.p. Working on a deals app. and I want to "shake to make". Basically a new deal when you shake. Upvote 0
Thanks guys I will try it a.s.a.p. Working on a deals app. and I want to "shake to make". Basically a new deal when you shake.
B bluedude Well-Known Member Licensed User Longtime User Dec 22, 2010 #9 Just tried the zip, it is very sensitive and even a slight move says "shake". Will pay around with a few parameters. Thanks for the great effort! Upvote 0
Just tried the zip, it is very sensitive and even a slight move says "shake". Will pay around with a few parameters. Thanks for the great effort!