Category "android-service"

is it recommended to use Android WorkManager for long tasks?

I have to create an application that activates the proximity alert at certain times of the day (this period of time can be several hours long). The proximity al

How to call suspend function from Service Android?

How to provide scope or how to call suspend function from Service Android? Usually, activity or viewmodel provides us the scope, from where we can launch suspen

Fatal Android 12: Exception: startForegroundService() not allowed due to mAllowStartForeground false

I noticed one exception (Firebase Crashlytics) for Pixel 5 and Pixel 4a (both on Android 12), no other devices, happened only two times, one time for each devic

Android 12 - Foreground service launch restrictions

I'm developing an SDK that needs to startForeground service from the background. Because it uses background location and Bluetooth-related works. If the applica

Adding function to foreground service lifecycle methods can create an issue? Is this best practise?

I created a timer app. So it's counting time basically and I'm saving the time to room when service close in OnDestroy scope. Is it best practise? Or is there a

Android 8.0: java.lang.IllegalStateException: Not allowed to start service Intent

On application launch, app starts the service that should to do some network task. After targeting API level 26, my application fails to start service on Androi

Minimal android foreground service killed on high-end phone

I'm trying to create an app that lets users log routes (locations/GPS). To ensure locations are logged even when the screen is off, I have created a foreground

PendingIntent does not send Intent extras

My MainActicity starts RefreshService with a Intent which has a boolean extra called isNextWeek. My RefreshService makes a Notification which starts my MainAc

Service stops running after a while on the real device ( > 40 minutes ) works on emulator

Friends, I created an android background service that is called every 2 minutes. When its called it starts listening for locationUpdates for GPS and NETWORK for