I want to develop in android a simple application: when the user push a button, an index will be increme开发者_如何转开发nted until the button is released. Which button events i have to use? Thanks
Use an OnTouchListener. And as the others said, you should accept answers to some of your previous questions.
This code implements an open-source prototype, the Android HCI Extractor, which tracks and monitor the user and system interaction events in multimodal applications (e.g. touch, keypresses, scroll, number of elements provided by the system, etc.)
Android HCI Extractor code: http://code.google.com/p/android-hci-extractor/
In the source code you can find the class /android.hci.extractor/src/org/mmi/android/instrumentation/filters/NavigationInputFilter.java in one method is aimed to control the touch-press, the touch-move and the touch-release events. The method is called "public boolean onTouch (View v, MotionEvent event)", and the MotionEvent is the extra information that describes you the action made with the finger. In this clas you can also find other methods aimed to control clicks and itemClicks.
Further information about the MIM project (including tutorials about the tool integration and usage): http://www.catedrasaes.org/trac/wiki/MIM
I hope it helps you!!
精彩评论