Working with the Trackball Android

Some Android devices have hardware trackballs, but not all. Developers can handle trackball events within a View control in a similar fashion to click events or gestures. To handle trackball events, you can leverage the View class method called on Track ball Event().This method, like a gesture, has a single parameter: a Motion Event object. You can use the getX() and getY() methods of the MotionEvent class to determine the relative movement of the trackball. Optical track-pads such as those available on the Droid Incredible can be supported in the same way.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

Android Topics