Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8630547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:05:08+00:00 2026-06-12T09:05:08+00:00

i would to implement a method with a SPenTouchListener of SPen SDK. The listener

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:05:09+00:00Added an answer on June 12, 2026 at 9:05 am

    You can create a Handler

    private Handler mHandler = new Handler();
    public void updateUI() {
            mHandler.postDelayed(mUpdateTimeTask, 10); //10ms
        }  
    
        /**
         * Background Runnable thread
         * */
        private Runnable mUpdateTimeTask = new Runnable() {
               public void run() {
          updateTouchUI (param...); //Your function
    
                   // Running this thread after 10 milliseconds
                   mHandler.postDelayed(this, 10);
               }
        };
    

    And add updateUI() in onClickEvent of your desire Button

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to implement a generic method on a generic class which would allow
How would you implement a Listener that is queuing events that are executed at
I would implement a method that receives in input two object date and calculate
I would like to implement a method like this: boost::unique_future<int> foo() { return defer([=]
I would like to implement a method that can get the svn revision number
I would like to implement a method that returns one or a list of
I would like to implement method that takes arbitrary Seq[T] and returns Seq[T] as
I would like to implement a method that receives a root object and returns
I am making a new window open and would like to implement the method
Lets say we have a method below. How would you implement auhorization that would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.