Skip to main content

Thread handling

About thread handling

The Encap API creates a background thread to perform the necessary communication with back-end servers when the application invokes one of the asynchronous methods.

These operations happen on a separate thread, therefore they do not block the application's user interface.

How does thread handling work?

Once a back-end operation finishes, the Encap API runs the callback that was passed to the method call in the context of the activity's runOnUiThread(Runnable), so that the callback can update the application's user interface.

Note

This process happens regardless of whether the operation is successful or not.