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
4
votes
0 answers

Android: Should I use BroadcastReceiver vs Messenger vs BindService vs Handler

I know this look like tons of question around SO. But it's not (although I can also be wrong). I have a long running Service (running in a separate thread using blutooth socket pooling for data in a OBD2 adapter every 5 seconds). This Service is…
4
votes
2 answers

Android bind with existing service across multiple apps

I have a Service implemented in a Module A. Now Apps B and C uses this library to bind with service using bindService(service, connection, BIND_AUTO_CREATE) but it always creates a new instance of Service. I'm using Messenger to return binder to the…
Bharath Mg
  • 1,117
  • 1
  • 9
  • 18
4
votes
1 answer

How to send zip file on server using background Service in Android

In my app user fills some fields and i save user data in a file Now i want to send all files to server when internet is available. In which way i can implement a service which use less resource Like Battery. Check connectivity after certain…
4
votes
3 answers

Service and Android Application lifecycle

I'm a little bit confused. I've read that the biggest benefit of using a started service is that this is independent from the application so, even if the android kills your application, your service is still alive. My questions then are: 1) If my…
FVod
  • 2,245
  • 5
  • 25
  • 52
4
votes
2 answers

onUnbind not being called when binding the activity to a running service

I have this activity that starts and binds to a service: @Override protected void onStart() { super.onStart(); Intent intent = new Intent(context, SoundService.class); context.startService(intent); context.bindService(intent,…
expGuy
  • 97
  • 1
  • 10
4
votes
1 answer

Stopped Foreground Service Restarting Itself

I have a foreground service in which I register for location updates, and intent filter for the battery intent Intent.ACTION_BATTERY_CHANGED, and a LocalBroadcast. All of these I remove in the onDestroy of my service as once this service is dead. I…
StuStirling
  • 15,601
  • 23
  • 93
  • 150
4
votes
2 answers

Android download queue using DownloadManger

I'm using DownloadManager to download my files in android and its great since it handles everything (connectivity lost, retry, etc.) The problem is I want my file to be downloaded in queue one after another and as far as i know DownloadManager…
4
votes
2 answers

My WearableListenerService is not started when Android wear restarts

I have an android Application that (among other things) show notifications on an Android Wear device. This is done by having a class in the Wear module extend WearableListenerService. In the Wear module, I also have a class that extends…
3
votes
1 answer

Can a non-privileged Linux native executable in Android communicate with a regular application using Binder?

In order to test and control my regular android application, I wrote a command line Linux test program and used adb shell to execute this test program. I can send a broadcast or start an activity to/from my android application indirectly by…
3
votes
0 answers

Why do I get "FAILED BINDER TRANSACTION" when my activity stops?

I have a background service that generates bitmap images and sends them to an activity if it is in the foreground. The activity finds the service via binding using bindService() and then registers itself using my own addUpdateCallback() and…
3
votes
1 answer

MediaBrowserServiceCompat methods

How do I access the public methods that I have defined (not the overridden ones) in the MediaBrowserServiceCompat from an activity? Earlier I had used just the service, so I could bind it with the activity class and then access the methods…
3
votes
0 answers

Casting android.os.IBinder causes ClassCastException once in a while

I am experiencing a weird ClassCastException exception when trying to cast an IBinder to a local's service Binder. This happens once in a while, and I personally cannot reproduce it (only know about it thanks to Crashlytics). The stacktrace is as…
3
votes
1 answer

How can I lock down an Android service to my company?

Background: I'm building a service into the Android OS and I would like it to be accessible only to apps published by my company. This service is implemented as a component of a Java-based system app, and said system app must be signed by the…
3
votes
1 answer

Android M permission revocation - protecting a service with a "dangerous" permission

I have app A which exposes a service through an AIDL and app B which binds to and invokes methods on that service. App A defines a custom permission with "dangerous" protectionLevel which is used to guard the service and is claimed by app B. Does…
3
votes
1 answer

Bind service from singleton

I have a started service that handles a connection and that keep an array of objects. On the other hand, I have a singleton that should bind to that service in order to get one of the objects handled by the service. So, how could I bind the service…
FVod
  • 2,245
  • 5
  • 25
  • 52