Questions tagged [android-service-binding]

In Android applications, a bound service is an implementation of the Service class that allows other applications to bind to it and interact with it. Service binding is used to allow services to be consumed from other components.

In Android applications, a bound service is an implementation of the Service class that allows other applications to bind to it and interact with it. Service binding is used to allow services to be consumed from other components.

More Info

420 questions
5
votes
1 answer

Context.startForegroundService did not then call Service.startForeground: Alternative solution

Note: This question assumes you know binding a service to a context. Everyone on the production is aware of this issue, or even some users that have an Android Oreo or Pie device. The exception looks like this: Fatal Exception:…
5
votes
1 answer

Instrumentation test cases for InputMethodService

I have extended the InputMethodService class to create my a custom IME. However, I am struggling to write valid Instrumentation test cases to verify the behavior. Previously the Service, could be tested using ServiceTestCase. But…
5
votes
2 answers

Issue Moving from IntentService to JobIntentService for Android O

I am using Intent Service to monitor Geofence transition. For that I am using following call from a Sticky Service. LocationServices.GeofencingApi.addGeofences( mGoogleApiClient, getGeofencingRequest(), …
5
votes
1 answer

Is a TileService considered as foreground process

In Android O we have some new background limitations. For example we can only register implicit broadcasts via the Context.registerReceiver method. When the system kills our process (e.g. as a result of low memory) the registered receivers will also…
Cilenco
  • 6,951
  • 17
  • 72
  • 152
5
votes
1 answer

What happen when the activity crash?

I have a service created like this : Then I implement the onBind…
user7898586
5
votes
2 answers

How to prevent service be closed when app crashes-android

I have a service in foreground which NOT stop when the app is closed but it DOES stop when the app crashes, I want the service continue running if the app crashes, how can I get this result?
angel
  • 4,474
  • 12
  • 57
  • 89
5
votes
0 answers

Android service only starts in debug mode

I have created a Service that manages XMPP connection. My application needs to receive XMPP messages periodically. Everything seems to work as expected, but only while the phone is plugged in to Android Studio and I run the app in debug mode. When I…
5
votes
1 answer

Can I start NotificationListenerService in code explicitly rather than it be started for me by the OS?

I have class derived from NotificationListenerService and it is getting created and started for me automatically when the app starts. However I would like to lazily start the service later from an activity and not have it start automatically when…
Gruntcakes
  • 37,738
  • 44
  • 184
  • 378
4
votes
5 answers

How do I enforce Application onCreate after app was closed and a service is running in the bg?

Basically I've got an application that runs a foreground service. When I start the application I need to do session specific initialization in the Application's onCreate method. When I close the app, the service keeps running (desired behaviour),…
4
votes
3 answers

How to bind CallScreeningService?

I want to get the Call Details and block the calls(if necessary). As the TelecomManager endCall method is deprecated and as per the documentation it is suggesting to use the…
4
votes
2 answers

Stop a service by unbinding all bounded activities

I have a started and bounded service (music player) and I want to stop it when the notification's close button is clicked. however, the service will not be stopped if there are activities bounded to it. How can I stop service when the button is…
4
votes
0 answers

Android O background execution limits not fully applied with bounded and started service

My sample app uses targetSdkVersion 26. I have a simple service, which is both started and bounded with the following code snippet: val intent =…
4
votes
2 answers

Android Service: Restarting once killed or removed from task stack from phone(Clear All) tasks

I am trying to run my service continuously in background. I understand it will drain a lot of battery but still it is a use case for me. Case 1: Starting BackgroundService using startService(intent) method. Case 2: Starting a BoundService using…
4
votes
0 answers

Binding to an AIDL service in ReactNative

We have developed a ReactNative android application and we want to bind to an AIDL service in one of our .aar dependencies. How can I bind to an AIDL service in reactnative for Android ?
Farhad
  • 12,178
  • 5
  • 32
  • 60
4
votes
0 answers

Android- accessibility service - performGlobalAction() returns false

Please don't think my question as a duplicate of this one (Accessibility Service - performGlobalAction() returns false) I'm calling performGlobalAction() method in my accessibility service class onStartCommand() and parameter would be…
rehman_00001
  • 1,299
  • 1
  • 15
  • 28
1 2
3
27 28