i would to implement a method with a SPenTouchListener of SPen SDK. The listener works fine but i would to capture data of touch (coordinates, etc.) every 10ms from the first touch of the user since the user press another button. How i can do this?
Thi is part of code of the listener:
public boolean onTouchPen(View view, MotionEvent event) {
updateTouchUI(event.getX(), event.getY(), event.getPressure(), event.getAction(), "Pen");
}
private void updateTouchUI(float x, float y, float pressure, int action, String tool){
mX.setText("X : " + String.format("%.2f", x));
mY.setText("Y : " + String.format("%.2f", y));
mPressure.setText("Pressure : " + String.format("%.3f", pressure));
}
In other words i want to call the updateTouchUI every 10ms for since the user press a button in the activity. Also i want to capture timestamp every time.
You can create a
HandlerAnd add
updateUI()in onClickEvent of your desireButton