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

Android Build a Simple Android App (retired 2014) Shaking Things Up Running an App on a Device

Ludwig Saverstam
Ludwig Saverstam
2,894 Points

LG G2 Running an app on a Device

Hello!

My name is Ludwig from Stockholm Sweden and I learn coding on your site it is great. Thanks for a great coding learning site. Information for LG devices which you probably should add on the site.

I had though HUGE problem connecting my LG G2 to eclipse. But the solution is quite easy download lgs software on your laptop. And then you need to ROOT your device. Please search google on how to do that. Otherwise Eclipse wont find your device.

Now to my question, I have followed your videos accordingly and all my code is as yours. The app runs perfectly on my phone but nothing happens when I shake it. If I add the button it works fine! Is there some problem with LG phones on Eclipse or what? Please help me thanks

1 Answer

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

It seems you have discovered a device-specific bug. Sadly I don't have an actual LG device to test on.

One thing you could try is adding some log statements inside the ShakeDetector class. For example, if you add the following line in the onSensorChanged() method after the variable maxLinearAcceleration is set, do you get any values?

Log.d("SHAKE_TEST", "max_accel: " + maxLinearAcceleration);