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

Bind to a service - call back when bind has been successfully - Android

I've come to a point where I don't know an elegant way to do this. Let's say I've a Fragment, named FragmentA, and a Service named BackupService On FragmentA I bound it to the BackupService using: private ServiceConnection backupServiceConnection =…
dazito
  • 7,740
  • 15
  • 75
  • 117
0
votes
1 answer

How to create service likes of viber ,facebook which runs continuosly in background?

I am trying to make app which uses services.But i need services to run continously.I dont want it to be stop if i use 3rd party app such as 360 security ,task killer.I have created my services like this way.Thanks in advance. @Override public…
0
votes
1 answer

How to call onStartCommand multiple times in a test?

i have the following design: public class MyService extends Service{ protected Logger _log; int _counter; onStartCommand(...){ _log.print (++_counter); } } public class MyServiceTestWrapper extends MyService{ public void…
0
votes
1 answer

AOSP: Error creating instance of a SystemService in Activity.java

I have added a custom system-service to AOSP. I wanted to make use of my service in Activity.java class and wanted to do some changes in startActivityForResult() method. The same way I want to create an instance to PackageManagerService. But for…
0
votes
1 answer

AsynTask and Service binding

This is a very silly one, and it's only because I don't like my code outputting errors to logcat that I'm asking about it. I have a service called BackgroundCollectorProcess. It's main job, it to process rows in the database that haven't yet been…
0
votes
1 answer

Service that run even after application exit and can able to stop when user want to stop

I am very new to services In my application there is a 2 button "start" and "stop" if user press a start button then i want to start a service that can run even after the application is closed and when user again open the application if he press…
Sandy
  • 985
  • 5
  • 13
0
votes
1 answer

Android - Keep app in focus with service

I've got an app for kids in which I want to prevent them accessing phone features. It doens't have to be rock-solid, just avoiding accidental exits. The approach I am using is to start a service to monitor when my Activity goes out of focus, which…
0
votes
2 answers

AOSP not loading due to one line of code

So I had created a new Service and added to AOSP. The service runs fine when being called from apps. But I want to call few methods of the service from inside the framework code…
0
votes
2 answers

IBinder Android - ClassCastException : android.os.Handler&MessgerImpl

I have run into the ClassCastException when using IBinder for android within a process. Following most of the online guides, inside of my service, I have public class TestBinder extends Binder { } In my client, private ServiceConnection…
Hammer
  • 8,538
  • 12
  • 44
  • 75
0
votes
1 answer

How to keep a service running even when app is cleared?

Is there a way to ensure a service will continue to run in the background after being started, even if the user clears the app from the recents screen? A perfect example would be Pandora's app, once it starts playing, even if you clear it from…
0
votes
1 answer

What is the point of using Android Binder class?

The documentation says: If your service is used only by the local application and does not need to work across processes, then you can implement your own Binder class that provides your client direct access to public methods in the service. But…
atok
  • 5,880
  • 3
  • 33
  • 62
0
votes
1 answer

Building an Android service that polls a REST service and sends data to an activity

I'm a .Net developer working on my first Android app. I am struggling with the learning curve, and I was hoping someone could give me a push in the right direction; I've found so many tutorials that don't quite fit what I want to do and I'm having a…
0
votes
1 answer

nullpointerexception when activity is trying to communicate with bounded service

I am trying to make my activity communicate with a running background service, but keeps getting a NullPointerException, which doesn't make any sense.. for me at least. Hope someone else can figure out what the problem might be. First here is my…
0
votes
1 answer

android onServiceConnected in bound service is never called

I am trying to bound a service to my activity and get location values from it. I have the following service: GPSService.java public class GPSService extends SensorElement { // Binder given to clients private final IBinder mBinder = new…
0
votes
1 answer

Android: How to tell when a bound service has been destroyed?

I've got a service that's bound to from a couple of activities, each using a ServiceConnection. Each activity needs to check before calling the service whether the service is already in use. So in the service I have a function (let's say…
Mick O'Hea
  • 1,619
  • 2
  • 14
  • 20
1 2 3
27
28