Questions tagged [bindservice]

44 questions
1
vote
0 answers

Service bindService vs LocalBroadcastManager

I have multiple activities and a background always running service (see context here). Which approach is better, use bindService() or app confined notifications using sendBroadcast() and a BroadcastReceiver in each activity? Thanks
Gabe
  • 5,997
  • 5
  • 46
  • 92
1
vote
1 answer

Android Service donot get Bound

Hi I am new to android and exploring the services part.I could not bind the service using bind method.I could not figure out whether it is problem with bind method or on service connected.Someone please help me with it.Thanks in advance Activity…
1
vote
0 answers

Bind service using nested class

I am following tutorial for bind service,this is my code server public class Server extends Service { IBinder mBinder = new LocalBinder(); @Override public IBinder onBind(Intent intent) { return mBinder; } public class LocalBinder extends…
0
votes
0 answers

In Android >= 10,How to bind to a Service in another Android app that has not been started yet?

Question:I have an Android app that needs to call a Service provided by another app, but when the other app is killed, bindService() returns false. How can I achieve this on Android 10 or later? private boolean bindService() { try { …
Mistletoe
  • 1
  • 2
0
votes
0 answers

Difference between BIND_ALLOW_OOM_MANAGEMENT and BIND_WAIVE_PRIORITY

I am trying to learn the Binding flags. When i encountered the BIND_ALLOW_OOM_MANAGEMENT developer.android.com says; allow the process hosting the bound service to go through its normal memory management. It will be treated more like a running…
0
votes
1 answer

Flutter GetX stream value not changing when text field value changes

So, I'm trying to display a stream using a list view from a stream function, that takes an input from the text field. Stream> queryByName(search) { return…
0
votes
2 answers

How to get the client id which is trying to bind my service in Android

I have read thread in the below link. But this is too old and many said in various possiblities. How to get application package name or UID which is trying to bind my service from onBind function? I have altered the question according to my need. I…
RKVM
  • 67
  • 6
0
votes
1 answer

How to test the process that a client of an Android bound service bind to the service?

I have an service App that defined a bound service, and another client App that one of its activity binds to the bound service. How can I write test case to test the bind service process? The code of the client App binding to the service is similar…
bubuStar
  • 563
  • 1
  • 3
  • 8
0
votes
1 answer

Keep audio playing with bound foreground service

I am getting my head around binding services, foreground services and how to use them for audio playback. Based on this example I have set up a Foreground Service to play audio. This works perfectly for my use case until I try to bind the service,…
atschpe
  • 121
  • 14
0
votes
1 answer

Android Things with bindservice and kotlin - onResume and onPause Or Coroutines Or RxJava

In this project: https://github.com/neuberfran/SmartDrive5, file: ModoComFirebase.kt I have issue BCM18 is already in use by PID, Because this gpio was opened in DriverService.kt file before. My question is: The Application class ModoAutomatico.kt…
0
votes
0 answers

Cannot 're-bind' to same service

I'm building a timer app. The timer runs on a service and updates the ui. The app starts the service inside onCreate(). getApplication().startService(intentService); getApplication().bindService(intentService, serviceConnection,…
ovalb
  • 555
  • 6
  • 15
0
votes
1 answer

How to catch bindService failure

I have some foregraund IntentService which could be ran or stopped. I need to reflect its progress(current state which is quite complex) on the Activity if it is visible. I did not find the reliable and good way to find out whether my IntentService…
engilyin
  • 1,011
  • 9
  • 22
0
votes
1 answer

Refresh Main Activity when my Bind Service changes its state

I need to refresh Main Activity when my Bind Service changes its state. Code for my MainActivity : public class MainActivity extends AppCompatActivity implements UDPService.OnHeadlineSelectedListener{ protected void onStart() { …
0
votes
0 answers

why restart the service

i have a problem in my service, the service is runnig from MainActivity (i am doing test) and extends of service. i want to use the service from foreground and background (when the app is closed) and i already have my first problem: my service(have…
0
votes
1 answer

Service starts activities from different Apps

I developed two apps(can be more in the future) which are using the same service. When I start one of the apps they should start the service(if not already started) and send the name of an activity to tell the Service that the app is available. The…
Fabian
  • 177
  • 1
  • 14