I'm working on optimizing frame rendering and UI updates in an Android application, and I'm trying to understand the difference between Choreographer.postFrameCallback
and Choreographer.postVsyncCallback
.
From my understanding:
Choreographer.postFrameCallback(Runnable r)
: Schedules a callback to be executed on the next frame.
Choreographer.postVsyncCallback(Runnable r)
: Appears to be related to syncing with vsync, but I'm not sure how it differs in behavior from postFrameCallback.
My questions are:
- What are the key differences between
postFrameCallback
andpostVsyncCallback
? - Are there specific use cases where one is preferable over the other?
- If I'm performing animations or drawing operations, which method should I use for optimal performance?
Any clarification on when to use each method would be greatly appreciated!