What is the purpose of runOnUiThread in Android games?

106 Views Asked by At

Cocos2d-x (3.17.1) uses GLThread and any operations happening on the engine are run on GL Thread. runOnGLThread method is used to evalString JavaScript from JAVA.

We have developed an Android game using Cocos2d-x JS. There are a lot of JavaScript to JAVA calls via JSB for operations that includes purchases, Facebook login, and game play services (achievements/ leaderboards).

Calls to JAVA from JavaScript continues on the GL Thread if runOnUiThread is not used.

Is it necessary to do all the JAVA calls via JSB in runOnUiThread?

0

There are 0 best solutions below