Coroutines เป็นโซลูชันของ Kotlin สำหรับ การเขียนโปรแกรมแบบ asynchronous การเขียนโค้ด async (network calls, database operations) ที่อ่านได้แบบลำดับโดยไม่ block main thread เป็นวิธีสมัยใหม่ที่แนะนำในการจัดการงาน async ใน Android โดยหลีกเลี่ยงความซับซ้อนของ callback
ทำไม async จึงสำคัญใน Android
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.
