Friday, 28 April 2023

Maximize View.OnTouchListener sample rate?

When a View.OnTouchListener() is receiving MotionEvents (including historical ones that occurred since the last call to onTouch()), does Android (13) capture samples at the highest rate the phone's hardware is capable of, or does it normally limit the sample rate, and only kick it up to max if you somehow explicitly ask it to (kind of like a gaming mouse that's capable of delivering 1000hz+ sample rates when requested, but normally limits itself to 125 or 250hz under Windows to improve battery life).

Along a similar line... is View.OnTouchListener() the way to get touchscreen samples at the absolute maximum rate the hardware allows, or is there some new/alternate API (probably intended for gaming) that exposes higher sample rates than the phone would normally be inclined to use?

If there is a way (available as of Android 13 on a Pixel 7 Pro) to sample the touchscreen at a faster rate than View.OnTouchListener() normally allows/defaults-to, what is it?

Note that I'm not asking, "How can I make onTouch() get called more frequently". The current reporting rate and historical batching is fine. I just want the sample-to-sample time of those batches to be as low as the hardware & Android conceivably allows.



from Maximize View.OnTouchListener sample rate?

No comments:

Post a Comment