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

So I have a bound service, is there a way that I can use the service in the onResume of an activity?

Code: @Override public void onResume() { super.onResume(); Intent intent = new Intent(getActivity(), UserAPIService.class); getActivity().bindService(intent, mConnection, Context.BIND_AUTO_CREATE); …
Nick
  • 925
  • 1
  • 8
  • 13
0
votes
1 answer

Nullpointer returned by function implemented in Locally bounded service in android

I am writing a locally bound service in android.My application has two classes viz. Activity and a Service In my activity I have one TextView and one button. I am starting and binding the service in onCreate() method of the activity. When the button…
Samrat
  • 161
  • 2
  • 16
0
votes
0 answers

Android, why is background thread stopped?

MainActivity starts my TestService in onCreate and bind in onStart method. AsyncThread is started in TestService onStartCommand. bind and unbind methods are called in correct sequences. All things work perfectly, absolutely no issue :). Issue…
0
votes
2 answers

How to pass Object of Service to MyActivity?

First of all: I am bigger in Android programming I have created simple TCP Socket using Service. The client connects to server when the button in MainActivity is triggered. Now i want to create PrintWriter object in MainActivity using Socket…
Suroor Ahmmad
  • 1,110
  • 4
  • 23
  • 33
0
votes
2 answers

Android Bound Services: Why do we cast this IBinder instance into an IBinder instance?

In the developer docs for Bound Services, the following code example is given for "Extending the Binder Class" in "Creating a Bound Service". The following code snippet (I have removed irrelevant bits) is given in which the Service returns an …
0
votes
1 answer

Android, service closed when kill app and no autostart

I don't know why but every time a kill my app, also the notifications are removed and no service is created. It should start also on boot, but it doesn't seem to.. My manifest:
M4rk
  • 2,172
  • 5
  • 36
  • 70
0
votes
1 answer

Is it possible to have Android app without any Activities, but only with Services?

How can you make an app that does not contain Activity as main launcher, but contain service as main launcher?
0
votes
3 answers

Toast not displayed in bound service example using messenger

I'm following the example on android guide for bound service using messenger and running the following code snippet. I've modified the snippet slightly to have a hi and a bye button and the service should display the toast hi or bye depending on…
Bunny Rabbit
  • 8,213
  • 16
  • 66
  • 106
0
votes
1 answer

Android Service not Register

I am new to android. I want to build a app which start a service when the first activity start. And that service want to stay when I leave the main activity. Because the next Activity use that service to do some operation. So i write some code for…
0
votes
1 answer

Turning an existing application into a service?

I have seen the documentation on Services and am trying to turn an existing application into a service. I have seen varying answers on how difficult this is. Which functions must you override to turn existing code into a service?
user3293643
  • 91
  • 1
  • 3
  • 12
0
votes
1 answer

Starting a service from another Apk from a ResolveInfo

I'm creating an app that reads every Service that has an IntentFilter that matches a custom action by using this: Intent intent = new Intent(ACTION); List infos = getActivity().getPackageManager() …
0
votes
2 answers

how to prevent other app to bind to my service

I can find the way to setup Bound Services in android AIP Guides! This demo allows any app to bind to it.But what I want is only my apk can communicate with the service I code.Is there any way to do it? How to? Thanks!
0
votes
1 answer

How to bind a service from a fragment?

I can't figure it out how to bind to a service from a fragment. Can anyone give me an idea about how to do it?
0
votes
1 answer

Bind service from a thread

Is it possible to bindService to a Service from a Thread? I try to pass a String to the Service running, and the run a method to show a notification? Any idea what's the correct way to do it? Thanks in advance.
0
votes
3 answers

Performing Request After Android Service Binding

I have a two part question. Both are somewhat general. I'm creating an app that relies heavily on communication with a server. I plan to have different classes for each repository I'll need. Is an Android service the correct pattern to use here?…
MrGrinst
  • 970
  • 3
  • 9
  • 20