Android Gyroscope examples?

2019-01-11 21:05发布

问题:

I'm sure this has been asked here many times but, are there any examples on the Internet about gyroscope Android development. Because the Gyroscope intrigues me and I think it could make for a pretty good thing to work with. I am just guessing the Samsung Galaxy S has a gyroscope, right? I hope so. Again though, my main need is for a tutorial, maybe even a good android programming tutorial/book (not just gyroscope related). I learned Java just for the purpose of Android development. I already knew C and a little OBJ-C so learning Java took a few weeks. So, one more time does anyone know any really good tutorials/books for Android development (I found a few tutorials on you-tube but their quality were so terrible I couldn't follow along) and maybe a good gyroscope tutorial for Android and a list of Android phones that have gyroscope built-in.

回答1:

Yes, all this has been asked before, and it's hard now to decide what a duplicate of is, because of so many questions here. Please, use the search box before posting questions, and ask one single question per post. Thanks.

Now, to answer your questions:

Books:

  • https://stackoverflow.com/questions/1114287/good-book-for-beginning-android-development-closed
  • Best Android 2.0 development book?

Sensors:

  • Android Gyroscope tutorial or sample code
  • Android accelerometer
  • http://www.helloandroid.com/tutorials/using-android-phones-sensors
  • http://stuffthathappens.com/blog/2009/03/15/android-accelerometer/
  • http://dansabin.com/2010/10/19/accelerometer-tutorial-for-android-1-6/
  • http://www.ibm.com/developerworks/opensource/library/os-android-sensor/index.html?ca=dgr-lnxw09Android-Sensors&S_TACT=105AGX59&S_CMP=grlnxw09

SGS:

Yes, it has accelerometer and compass sensors: http://www.phonearena.com/phones/Samsung-Galaxy-S_id4522



回答2:

You can check-out my simple demo-application which not only uses the Gyroscope, but also Rotation-Vector and Sensor-Fusions in order to rotate a cube.

https://bitbucket.org/apacha/sensor-fusion-demo

You can take the sensor-code from there and use it in an application of your choice.