Coroutine sono la soluzione di Kotlin per la programmazione asincrona — scrivere codice async (chiamate di rete, operazioni su database) che si legge sequenzialmente senza bloccare il thread principale. Sono il modo moderno e consigliato per gestire il lavoro asincrono in Android, evitando la complessità dei callback.
Perché è importante
The MAIN (UI) thread must stay responsive — blocking it (with network/DB work) freezes
the UI (ANR "Application Not Responding" errors):
→ long operations MUST run off the main thread (asynchronously)
→ old approaches: callbacks (nested, complex), threads/AsyncTask (verbose, error-prone)
→ COROUTINES make async code clean and sequential.
