I want to implement a content or fileobserver that would constantly run in background. I know that on Oreo I would need to start the service with "startForeground" and provide a notification channel etc., which shows a notification then once it runs.
I wonder how google photos or amazon photos that upload your new pictures do it. Never saw a notification. Well actually I just tested it, it isn't instant, at least with Amazon Photos.
Do they maybe use an AlarmManager that is scheduled to run in short intervalls using a BroadcastReceiver (PendingIntent.getBroadcast())?
If you use setInexactRepeating
that would be also battery friendly.