Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


ShakeDetector for the Crystal Ball app

Hi, I've noticed that in the Android reference docs for the SensorManger class, it says** "Don't use this mechanism with a Trigger Sensor". I see that on the **Sensor class reference that TYPE_SIGNIFICANT_MOTION is the only trigger sensor and that we in the project select the TYPE_ACCELEROMETER to test. My Question/s is/are +Would it be better to have a trigger sensor for the shake detector? +If so, could the shake detector file be changed to a triggerSensor class, then just change the initialization code in the MainActivity. Or would the whole shake detector file need to be re-written for the TYPE_SIGNIFICANT_MOTION sensor. Thank you in advance.

2 Answers

Ben Jakuben
Ben Jakuben
Treehouse Teacher

I've never heard of TYPE_SIGNIFICANT_MOTION, so I can't comment as to its feasibility for shake detection. If you try it out, let us know how it works!

Hi, I've been trying to use the TYPE_SIGNIFICANT_MOTION, but without success. I made a copy of the crystal ball app file from the workspace folder, but now i've put it back the errors that i had, when trying to use this sensor, are still there. Is there an eclipse cache that i can empty, or something??

Ben Jakuben
Ben Jakuben
Treehouse Teacher

If you do Project > Clean it will refresh and rebuild everything from scratch. If that doesn't get rid of the errors then there must be some other related problem.

That sorted it, Thank you.