Service అనేది Android component, ఇది UI లేకుండా కార్యకలాపాలను నిర్వహిస్తుంది — సాధారణంగా నేపథ్యంలో దీర్ఘకాల పని. వేర్వేరు రకాలు (foreground, background, bound) ఉన్నాయి, ప్రతి ఒక్కటి విభిన్న అవసరాలకు సరిపోతుంది, అయితే ఆధునిక Android అనేక సందర్భాల్లో WorkManager కు ప్రాధాన్యం ఇస్తుంది.
Service అంటే ఏమిటి
A SERVICE runs operations WITHOUT a UI (not tied to a screen):
→ for work that should continue regardless of UI (or independent of any activity)
→ declared in the manifest; runs in the app's process (main thread by default — must
move heavy work off it!)
సేవల రకాలు
FOREGROUND SERVICE → user-aware, ongoing work with a PERSISTENT NOTIFICATION:
→ music playback, navigation, active location tracking, ongoing downloads
→ higher priority (less likely to be killed); the notification is required
BACKGROUND SERVICE → work without user awareness:
→ heavily RESTRICTED on modern Android (battery) → often use WorkManager instead
BOUND SERVICE → other components BIND to it for a client-server interface (interact with
it, call methods); lives while bound
