androidandroid-service

foreground service without notification


I want to start a foreground service that doesn't show notification, apps like instagram, telegram, zapya, ... have a foreground service and they show no notifications. I have tested ways like answers here, but android shows a notification that yourAppName is running. I want to know how is that possible to have a foreground service with no notification or warning from OS?


Solution

  • Generally, you can not define foreground service without a notification. However, user can hide the notification of your app, so you can ask, but if the service gets started with no notification, it'll be killed by OS as soon as OS felt that it needs to be stopped.

    TL; DR

    No. For background task execution, the Android WorkManager is the newest and most reliable.