Coroutines Kotlin کا asynchronous programming کے لیے حل ہیں — async کوڈ (network calls، database operations) لکھنا جو main thread کو block کیے بغیر sequential طریقے سے پڑھا جائے۔ یہ Android میں async کام سنبھالنے کا جدید، سفارش شدہ طریقہ ہے، callback کی پیچیدگی سے بچتے ہوئے۔
Android میں async اہم کیوں ہے
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.
