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

How do I create an unbound service in Android?

Many examples and tutorials for services on Android are for bound services, but what if I want to create an unbound service and not have to deal with binding at all?   Note to potential downvoters Please read up on why answering your own questions…
Magnus
  • 17,157
  • 19
  • 104
  • 189
0
votes
1 answer

Activity and binder service

In my app I make use of a background service to do some background data fetching. I launch the service using bindService(intent, mConnection, Context.BIND_AUTO_CREATE); mConnection is instance of ServiceConnection. In service I keep fetching some…
Mandroid
  • 6,200
  • 12
  • 64
  • 134
0
votes
2 answers

How to stop a service only when the entire app is paused and closed and not use a base activity

I am looking for a solution to kill a service only when my app itself is paused or closed. Please note, I am not referring to one activity, I am looking for when any activity within the app is in the foreground while it is paused or killed. I…
Sofia Clover
  • 669
  • 1
  • 7
  • 18
0
votes
0 answers

Can we receive data from other apps in a Background Service?

according to android documentation we can definitely receive data from other apps in the activity as shown in the link. https://developer.android.com/training/sharing/receive.html So I tried this and it works perfectly, But I have special where I…
0
votes
2 answers

Android: Share object between Service in specific process and activity

How is it possible to share an object between a service running in a specific process and the rest of my Android app ? In my manifest I set process="com.test.myprocess" to the service declaration. I initialize a "session" object when my user login…
0
votes
2 answers

Null pointer exception on calling method of a service class from an activity class

I am trying to invoke method of a service class i.e getDur() from an activity class method i.e startPlay() but I am getting Null Pointer Exception. Below is the code of the project. I have also added some Log statements but nothing gets printed on…
coderahul94
  • 80
  • 3
  • 9
0
votes
2 answers

Bind SyncAdapter service to Activity

I'm currently working with a SyncAdapter that syncs data every 15 minutes. Is it possible to bind that Service to the Activity so I can show the user what the currenty sync status is? I read in the documentation about IPC between services and…
0
votes
1 answer

Android service run multiple

This is my service code: public class MyCustomService extends Service { public static final String INPUT_TEXT="INPUT_TEXT"; public static final String OUTPUT_TEXT="OUTPUT_TEXT"; private volatile HandlerThread mHandlerThread; private ServiceHandler…
medo
  • 479
  • 3
  • 9
  • 24
0
votes
0 answers

Service to check if JSON file is updated if updated Notification to user

abc.json [{"id":1,"title":"1. heading of Tips","description":"welcome to post 1"},{"id":2,"title":"2. heading of Tips","description":"welcome to post 2"},{"id":3,"title":"3. heading of Tips","description":"welcome to post 3"},{"id":4,"title":"4.…
Abhay Tomar
  • 175
  • 1
  • 9
0
votes
0 answers

One of my local bound services depends on another. How can I ensure it's not used until its dependency is ready?

I implemented parts of my Android app as two local bound services, one depending on the other. (I only use bindService() with them; never startService().) However, when I bind the service which has a dependency, I get a "bound" and "connected"…
0
votes
1 answer

How to start a service without open the activity (open the app on boot/or in any other way)

Is it possible to start a service without open the app or without launching the app. Explaining the scenario User Download and install the app. User do not open the app. Even not a single time after the installation. Now I want to start a service…
Alpesh
  • 265
  • 2
  • 7
  • 22
0
votes
0 answers

Limit Android Service Binding

IS there any approach allows the android service only accept the binding from specific components (NOT APP) which could be the components of partner's APP or in-house APP. Using permission doesn't satisfy my situation, because any APP declared…
0
votes
1 answer

Android duplicating service in some devices

I'm developing a simple Chronometer app which uses a Service (this is intended to keep the chronometer running even if the app has been closed). The chronometer logic is handled by the service and my Fragment just binds to the service to get data.…
0
votes
1 answer

Update UI from consumer service

I am building a simple producer-consumer usecase in android with following features: Main Activity has a Fullscreen ImageView Producer service populates a queue with images and time for which each image must be viewed Consumer thread reads these…
jay
  • 1,982
  • 2
  • 24
  • 54
0
votes
1 answer

service and three activity, start service is the right way?

I developed a Ble Android App composed from three activity and one service: - the first one to scan the device - the second one to connect to device - the third one to write communication result on the screen - inside the service there are some…