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
1
vote
1 answer

How to auto restart a service when killed?

I have already red many posts about the subject, some of these works, but only on some devices. For example it works on my Nexus 4, Nexus 5 with cyaogenmod, but not on my Xiaomi Mi2s (jelly beam 4.1.1) I tried setting it sticky, using alarm, and…
M4rk
  • 2,172
  • 5
  • 36
  • 70
1
vote
0 answers

Passing an object to a static method in an aidl service

I'm working on an app in which I need to implement a download mechanism for multiple items in the same time, In order to achieve maximum efficiency I want to implement it as an AIDL service However I have one thing I struggle to understand - since…
1
vote
1 answer

What happens to IBinder on onServiceDisconnected()?

Say I've created a bound service, and it has successfully bound and called onServiceConnected(). Now I have an IBinder object that I want to make a remote call with. But, if between getting the IBinder and the remote call, the service is suddenly…
nighthawk454
  • 943
  • 12
  • 20
1
vote
0 answers

find whether extras are passed to current running activity from a service

Im building an app in which i need to know the current running activity from a service. I was able to achieve this with the below code found in stack overflow: ActivityManager am = (ActivityManager) this…
1
vote
2 answers

Android Binder IPC addService: is there a way to remove service again?

I'm somewhere in the code, where i have only very limited permissions, but have to ship data outside to an android application. (Android system C code) Obviously I cannot start a binder service in there, but I can connect to an already running…
1
vote
0 answers

Is there any approach to ensure a service is bound?

According to the Android developer manual shows here, it seems to assume that once the client calls bindService(), eventually the service will be bound and the onServiceConnected() callback will be triggered. However, in my application I received a…
1
vote
1 answer

How to communicate between two applications in Android?

I'm developing a keyboard, so I'm implementing an InputMethodService. I have a requirement to add other features to this keyboard application but to separate it as another application in order to leave the keyboard as a lone keyboard…
Emil Adz
  • 40,709
  • 36
  • 140
  • 187
1
vote
0 answers

Blocked my own app with Service Class

I am trying to lock selected apps before opening them for a particular amount of time. After tons of research and failed implementations. I finally ended up getting my service class to somewhat work with my LockScreen activity. The big problem is…
1
vote
0 answers

Android communicating events from service to activity

I am building a music player in android for which I am using bound services to create mediaplayer and do all the background operations like playing media and pause etc like this. All the UI components in mediaplayer are implemented in activity and…
1
vote
1 answer

is it possible to bind multiple components to intentservice in android

As of I know, we can use Bound service if we wanna bind multiple clients to a service. But, there are many advantages of intent service over a service. So, I am wondering if it is possible to bind multiple components to an intent service. Also, is…
1
vote
1 answer

Android Service : onServiceConnected() is never called upon binding

There are numerous questions with the same title but they didn't help. So I am asking. I Have a service which is started successfully in my first activity. when switching to the second activity, I need to bind with the service. But the…
rahman
  • 4,820
  • 16
  • 52
  • 86
1
vote
1 answer

Communication from App to a SystemService in Android

I'm essentially trying to create a SystemService in Android. I read that intercommunication from an app to this service should be handled by a Handler? So what about returning some object from the Service's function to the calling app? How can this…
1
vote
2 answers

send Messages to service without binding it

i have created one service by extending Service in android and i am sending Message to service using Messenger and Handler. But the issue (which is a common behavior though) is whenever i have to send message to Service i have to bind it and when i…
Hunt
  • 8,215
  • 28
  • 116
  • 256
1
vote
0 answers

How to make a service working thought the process force killed in andorid?

I am starting and stopping a service from an activity calling startSertice()/stopService() (when user select/deselect a check box and service is not bounded). Every thing is working fine even though the activity that starts the service is closed.…
Jagan
  • 63
  • 1
  • 7
1
vote
3 answers

How to send data from service class to main activity class?

I am developing an android Application called Call recorder. The recording is done in background running service class. Now how can I received call info from service class to main activity class to show on UI ?
CreAToR
  • 63
  • 10