Romman Sabbir
Romman Sabbir | Official

Romman Sabbir | Official

Android Tips #8

Combine multiple tasks into single one.

Romman Sabbir's photo
Romman Sabbir
·Jul 2, 2022·

1 min read

Android Tips #8

Subscribe to my newsletter and never miss my upcoming articles

Play this article

You can combine multiple tasks into single one (Zipping) (Synchronous execution). Simply, define list of Tasks and get list of Results (Success or Error)

Practical Scenario:

Suppose, you have a form screen, where user can input multiple information. So, before sending informations to the backend server, you have to validate all those informations, let user know if there is any error. There can be multiple validations for each input from user.

Instead of writing all one by one multiple validations, you can define a list of Task which performs validation for every input and execute those to get the results (Either Success or Error). Thus you can combine all operations from validating to sending to server side which performs one by one. It's also easier to test the whole procedure or testing every single execution independently.

index.png

 
Share this