Questions tagged [android-service]

A Service is an application component representing either an application's desire to perform a longer-running operation while not interacting with the user or to supply functionality for other applications to use.

A Service is an application component representing either an application's desire to perform a longer-running operation while not interacting with the user or to supply functionality for other applications to use. Each service class must have a corresponding declaration in its package's AndroidManifest.xml. Services can be started with Context.startService() and Context.bindService().

Android Service Class Reference

Tutorials & Examples

6696 questions
2
votes
1 answer

GetActiveNotifications returns null

I have a messenger application and now I'm doing push notifications part. I'm using FCM (Firebase Cloud Messaging)for this. Now I have a problem. For example introduce 2 users (user1 and user2). If user1 writes me, I'm getting notification with FCM…
2
votes
3 answers

Which lifecycle events are called when an app is removed from recent apps list?

As far as I understand from this question and the official reference and guide, only onDestroy() is called, when my app gets removed from the recent apps list. In my app I have a single activity which starts a service to play music. In the…
BraveSentry
  • 339
  • 4
  • 19
2
votes
1 answer

How to access the activity from within a service in cordova plugins?

I'm building an App with Cordova and right now I'm focussed on a Background Service. I need that Service for Notifcations and to update them regularly, which is working quite well already. When a user clicks on the notification, it should open the…
2
votes
1 answer

Android Socket.io Background Service

I have a socket.io library. It's a websocket library on JavaScript. I want to keep alive 7/24 the service but the android OREO have background service limits. How can i solve it ? I want to check the client is alive or not. The whatsapp, facebook…
2
votes
1 answer

Android WorkManager - not working well after application kill

I created simple workManager and I want that in background worked for-loop 50 times every 1 second, so it will iterate loop every 1 second and show log. First let me introduce my code. This is WorkManager class. public class WorkerClass extends…
2
votes
0 answers

Is it possible to IntentServices to be called out of order?

I have 2 calls to startService made on the same thread, but apparently these calls are received out of order in my IntentService. Our client says that the feature works on some devices and no on others, so I'm guessing this out of order could be…
Paulo Morandi
  • 147
  • 1
  • 10
2
votes
0 answers

Android AIDL Service is creating new processes

I was under the impression that if I have an AIDL service in my application every new interface instance would be connected to the same application process, unless I have explicitly tagged that service in my manifest to run under another process. I…
TacB0sS
  • 10,106
  • 12
  • 75
  • 118
2
votes
2 answers

Android background audio with a live audio stream

I have come along in leaps and bound with my first android app in the last three days. This is my last hurdle. How do I get my app to run a background Service that will allow the audio to keep playing? I have tried several examples I could find…
iShaymus
  • 512
  • 7
  • 26
2
votes
1 answer

How to use the same service on multiple activities?

Is it possible to use the same service on multiple activities and if so how?
Sam
  • 6,215
  • 9
  • 71
  • 90
2
votes
1 answer

AlarmManager for calling a service in Android P: startForegroundService

I am using AlarmManager as below and its working fine for Android O and below. AlarmManager mgr=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE); Intent i=new Intent(context, PeriodicChecksService.class); PendingIntent…
Srihari Karanth
  • 2,067
  • 2
  • 24
  • 34
2
votes
1 answer

BroadcastReceiver doesn't receive the broadcast event message

I created my broadcast receiver AnprEventReciever that should be triggered when connectivity state changes, however it doesn't. AnprEventReciever: import android.content.BroadcastReceiver; import android.content.Context; import…
2
votes
1 answer

Service gets paused while app is in background && screen is locked

Inside a Foreground Service I encode media with FFMPEG. By logging the encode progress I noticed the process gets paused(in some devices) while device connected to adb over wifi(NOT USB) && screen is locked. I tried : try { final…
Mehran
  • 481
  • 1
  • 9
  • 26
2
votes
1 answer

ExoPlayer: play sound in the background with a video file

Playing a video, and when the app goes to background it should continue playing the audio, and when I reopen it should resume the video respecting where we are in audio. I'm using exoplayer in a service, I was able to play the audio in background,…
stallianz
  • 176
  • 1
  • 17
2
votes
0 answers

IllegalArgumentException when calling Tile#updateTile() in TileService#onStartListening()

Some users of my app are experiencing a crash I cannot reproduce. It is just a small percentage of the users which are receiving this crash, but currently it is the largest crash in my app, which I would like to solve. This is the stack trace I…
Thomas Vos
  • 12,271
  • 5
  • 33
  • 71
2
votes
2 answers

I want to create a service which run in background continuously and receive fire base notification

I'm new to Stackoverflow and currently working on an app that processes incoming notification from fire base and open the my application. As I was searching for a solution. The goal is to receive the notification even when app is in background and…
Lusifar
  • 21
  • 4