The Android 3.1+ supports joystick and gamepad, but there are not any examples. I tried to use onTrackballEvent and it didn't work. How can I use joystick in my Android App?
Check out the samples: http://developer.android.com/tools/samples/index.html
There is a GameControllerInput example in the "ApiDemos" project. Specifically /samples/android-rev/ApiDemos/src/com/example/android/apis/view/GameControllerInput.java
You can also find that online in a few places that mirror the code, such as: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/4.0.3_r1/com/example/android/apis/view/GameControllerInput.java