Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

"Correct" way to handle a long-term Foreground Service, with support for Android Oreo (8.0+)

$
0
0

Hey there,

As you may be aware, Android O brings in some battery/memory saving checks which means that services can no longer be run in the same way as previous versions of Android.

I'm just wondering what the correct way to handle these changes would be? I want to support Android O, but also target previous versions too.

Job Scheduling seems to be an option (https://blog.xamarin.com/replacing-services-jobs-android-oreo-8-0/), but other blogs say that it's fine to use Foreground Services (by calling StartForegroundService() as opposed to StartService(), with the notification priority of at least "Low" (https://medium.com/exploring-android/exploring-background-execution-limits-on-android-oreo-ab384762a66c).

Has anyone managed to get a working Foreground service going for both Android 8.0+, and previous versions?

Thanks in advance.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>