Android অ্যাপগুলিকে প্রায়শই ব্যাকগ্রাউন্ড কাজ করতে হয় — এমন কাজগুলি যা তাৎক্ষণিক UI এর বাইরে চলে, যেমন ডেটা সিঙ্ক করা, আপলোড করা বা পর্যায়ক্রমিক কাজ। Android বিভিন্ন প্রক্রিয়া (WorkManager, Services, coroutines) প্রদান করে যার বিভিন্ন ব্যবহারের ক্ষেত্র রয়েছে, সাথে OS থেকে গুরুত্বপূর্ণ সীমাবদ্ধতা রয়েছে।
ব্যাকগ্রাউন্ড কাজের বিকল্প
COROUTINES (in a ViewModel scope) → for async work tied to the UI/screen (network calls,
loading data) — runs while the screen is active
WORKMANAGER → for DEFERRABLE, GUARANTEED background work that must complete (even if the
app closes or the device reboots): syncing, uploads, periodic tasks, retries
→ the RECOMMENDED solution for most persistent background work
FOREGROUND SERVICE → for ongoing, user-visible background work (music playback, navigation,
active tracking) — shows a persistent notification
SERVICES → general background components (largely superseded by WorkManager/coroutines
for most cases)
