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

Why is startService() and bindService() only working when used in the activities' onStart() method?

Initially, I attempted to start and bind my services using a function in my MainActivity like so: public void startTimerService(){ Intent intent = new Intent(this, TimerService.class); startService(intent); ServiceConnection mConnection…
Matthias
  • 71
  • 1
  • 1
  • 7
0
votes
1 answer

Simple service won't bind : bindService return false, service connection never triggered

This is my first time using Service in Android and my service won't bind. The Service code : package mackosoft.almightymessage; public final class MainService extends Service { private final static String TAG = "Main Service"; private final…
Mackovich
  • 3,319
  • 6
  • 35
  • 73
0
votes
2 answers

How to stop multiple android services in a List of services that use MediaPlayer to play many songs simultaneously?

Hey guys sorry if this has been asked before but I have been reading other answers and documentation for more than 3 hours with no success, I really can't find how to solve this problem. Description So I have this List: private List
0
votes
1 answer

Sending data from bound Service's another thread to Activity

I have Activity and Service, which is called by bindService from Activity. In this service I perform some operations in another thread using Vk sdk. Here I parse json to my models and add them to list. My question is how can I send this list from…
Oleg Ryabtsev
  • 457
  • 2
  • 9
  • 24
0
votes
2 answers

Android - My service onunbind but no bind again

I'm stuck in a problem with a service binding that is giving me nuts. I got an activity that is binding a service, and is frequent that the user go in and out of that activity. The problem comes when the user goes out first time of the activity this…
0
votes
0 answers

Running a Foreground Service in Android

I'm creating a radio streaming app; in order to keep the audio playing when the user is working with other apps, I know I need to use a foreground service to run the code pertinent to streaming the audio. Currently, I have the following code in my…
0
votes
1 answer

What happens to a Service object after it's destroyed

Let's say I binded to a service, and got an object reference to it through the IBinder object. I store the reference in my Activity object as a field. Then I unbind the service causing its destruction. What does the Service reference in the Activity…
f.khantsis
  • 3,256
  • 5
  • 50
  • 67
0
votes
1 answer

how to cal the fragement method from the service

i have implemented service. it will run 3 minutes once in background. in the service i am getting the value from web service and storing in database . the user in the SAME UI , the data has to update . i am displaying data from database into…
John
  • 1,407
  • 7
  • 26
  • 51
0
votes
0 answers

Deleting a file in a queue in a Android service

In my app I want to download and upload file from and to server. I am using service to do it. In onStartCommand I am creating a thread which will download the content. I showing a notification of the download which has a pending intent. While…
Sniper
  • 2,412
  • 11
  • 44
  • 49
0
votes
1 answer

Cannot Run Tasks in Service

I know this is a basic question, I am new to android service. I have done research on Google and StackOverflow. There are many question in stackoverflow related to or similar to my topic, But I couldn't able to get the proper answer and I am being…
0
votes
2 answers

How to keep my services and process open even after user long press and kill the app

I want to periodically fetch data from server and put in database without opening the app so I want my service always open with or without activity knows about it. So I want to keep my service always open. This means I want my service not bounded by…
0
votes
1 answer

Problems keeping service alive through rotate, killing when leaving app, and turning screen off in landscape

I have a service that I need to meet the following conditions 1) The service needs to be running while the app is in the foreground. 2) When the activity rotates, do not stop the service 3) The service must remain active even if you minimize the app…
0
votes
1 answer

My background music service stops when I load a new activity. Am I connecting or binding wrong?

I'm trying to add background music to my game and I thought I could persist it across activities by starting the service and then just connecting and binding to it in different activities in order to control it. But my music stops playing when I try…
0
votes
0 answers

How do UIL(universal image loader) and Picasso organize download of images from different activities in background in queue?

I need to download images from server and store on my external storage. Imagine we have different activities and when open the (A) activity I need to download "N" number images and while the download of the "N" number of images is not complete I…
0
votes
1 answer

Converting Image to bytearray in order to upload image to server Android

I have image's sd card path. Now what are the next steps to convert image into byte array because I want to upload the image to server? Thanks in advance.