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
0
votes
1 answer

Timing of using android IPC mechanisms

There are several methods to do IPC in Android - Content Provider, Message, AIDL, Async Task, IntentService ... Seems like each of them aims to solve particular problem. How to decide which I should use? I need a service keep running in background,…
0
votes
0 answers

Is there a way for Activity to tell if the system is going to restart a Service after it has been killed by system?

Say I have an Activity that launches a Service using startService() when user presses a button. The service is stopped using another intent in startService() when user presses another button, or it can decide to stop itself. The service wants to run…
squirrel
  • 5,114
  • 4
  • 31
  • 43
0
votes
1 answer

Does Binder have to be an inner class?

I am reading upon Android Bound service, http://developer.android.com/guide/components/bound-services.html public class LocalService extends Service { // Binder given to clients private final IBinder mBinder = new LocalBinder(); // Random number…
Dave
  • 67
  • 1
  • 5
0
votes
0 answers

How to cnnect service android? Included new LocalBinder lib

How is the best easiest way to startService and bind service to work in my activity? I got to implement a LocalBinder service class into my activity class is my purpose, but how to use the startService and GetSerivce correctly? IS it a good way to…
Mikael
  • 633
  • 2
  • 8
  • 15
0
votes
1 answer

How to bind to a service in Android 5?

I am developing an app with a service. I try to import the app from Android 4.4 to Android 5 but I cannot bind to my service. The service is registered in the AndroidManifest. In my Application class,I start the service with : startService(new…
0
votes
0 answers

Android: Making a child listen to his parent (while being counseled by another)

I hope to explain this as best as I can, as I am not an expert on the subject: I have two children in child Services; MusicProvider and MusicService - both implement IBinder but neither agree on how they do things: MusicService takes care of setting…
0
votes
1 answer

Sending data to a bound service

I have a service that is started. In addition, other components can bind to the service. When a component binds to the service, it has new parameters it needs to deliver to the service. Is it possible to force onBind to be called each time a caller…
learner
  • 11,490
  • 26
  • 97
  • 169
0
votes
1 answer

Android Service with MediaPlayer gets recreated or destroyed

I'm using bound service so that I am able to communicate between an activity and a service. I'm binding to a service in onStart: @Override protected void onStart() { super.onStart(); Intent bindIntent = new Intent(this, MusicService.class); …
0
votes
1 answer

Android bindservice method returns false

I'm trying to call a method within an activity from another class (BaseExpandableListAdapter). The method in the activity starts a service and calls the bindService(,,) method. However the bindService method always returns false. I've checked other…
0
votes
0 answers

Maintaining service in an android application

I am quite new to android development and I have started making a music player. I have two activities. One is the main that you can see all the albums in the local storage and select one. Upon selecting one a second activity launches that displays…
Agraell
  • 83
  • 11
0
votes
2 answers

Stop/Pause/Sleep Service if connection unavailable and resume if available

I have an application in which I have created a service MyService.class Now MyService.class is tied to my activity using bindService() but I want my service to run in the background even if activity destroys itself. So I started the service and then…
0
votes
2 answers

unfortunately app has stopped while using service in thread

I am new to android development, and trying to make demo application on service. But as tutorials describe that services are running on main UI thread, I have created thread and put my service in that thread to execute in background. and it is also…
0
votes
1 answer

what kind of background-service to use for background request and saving

i am currently trying to get code running as a background service. what this code does is: send request to server with current location of the user receive response parse response save into model (singleton) and this is set to happen in a 30 sec…
0
votes
1 answer

Is it relevant to keep a mBound flag when binding a service?

As explained in the documentation regarding bound services, a mBound boolean is used to know whether a service was bound in an activity. Here is an excerpt of the code example given in the documentation: public class BindingActivity extends Activity…
piwi
  • 5,136
  • 2
  • 24
  • 48
0
votes
1 answer

bindService never calls onServiceConnected

My company produces an SDK delivered as an Android Library aar file. As part of that SDK, we define a service:
David Berry
  • 40,941
  • 12
  • 84
  • 95