Questions tagged [service]

A Service is a long-running executable that performs specific functions and which is designed not to require user intervention.

A Service is a long-running executable that performs specific functions and which is designed not to require user intervention.

Services usually provide an interface to Start, Stop, Pause and Restart the executable that is running in the computer's background.

23127 questions
98
votes
1 answer

Does the command systemctl and service exists on linux only and not mac?

Hi I'm trying to see the status of my apache services on my Mac. I tried the command sudo service httpd status but command not found I look up in Google and discover systemctl so I try that sudo man systemctl and it shows no manual entry for…
Henry Yang
  • 2,283
  • 3
  • 21
  • 38
98
votes
6 answers

Bind service to activity in Android

I'm trying to write a simple media player that plays streaming audio using RTSP. I have a GUI-activity and a service that performs the playback. My question is how to best communicate between the activity and the service (e.g. updating the GUI based…
aspartame
  • 4,622
  • 7
  • 36
  • 39
96
votes
7 answers

Accessing UI thread handler from a service

I am trying some thing new on Android for which I need to access the handler of the UI thread. I know the following: The UI thread has its own handler and looper Any message will be put into the message queue of the UI thread The looper picks up…
iLikeAndroid
  • 1,106
  • 1
  • 8
  • 6
96
votes
2 answers

Systemd with multiple execStart

Is it possible to create service with the same script started with different input parameters? Example: [Unit] Description=script description [Service] Type=simple ExecStart=/script.py parameters1 ExecStart=/script.py…
Riccardo
  • 1,011
  • 1
  • 8
  • 7
94
votes
15 answers

Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel

I'm running my Web Project in IIS. It is a 4.0 Framework APP. I have a Service.svc and I get this error when I run my Application. "Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel,…
Nicolas Gago
  • 1,039
  • 1
  • 8
  • 14
92
votes
13 answers

Cannot resolve Manifest.permission.ACCESS_FINE_LOCATION

When adding permissions to my manifest file, the below xml works. However, this xml doesn't work.
Pablo Cegarra
  • 20,955
  • 12
  • 92
  • 110
92
votes
4 answers

Install Windows Service with Recovery action to Restart

I'm installing a Windows Service using the ServiceProcessInstaller and ServiceInstaller classes. I've used the ServiceProcessInstaller to set the start type, name, etc. But how do I set the recovery action to Restart? I know I can do it manually…
Ray
  • 45,695
  • 27
  • 126
  • 169
91
votes
3 answers

catch on swipe to dismiss event

I'm using an android notification to alert the user once a service is finished (success or failure), and I want to delete local files once the process is done. My problem is that in the event of failure - I want to let the user a "retry" option. and…
Dror Fichman
  • 1,559
  • 1
  • 14
  • 16
90
votes
8 answers

Non-Singleton Services in AngularJS

AngularJS clearly states in its documentation that Services are Singletons: AngularJS services are singletons Counterintuitively, module.factory also returns a Singleton instance. Given that there are plenty of use-cases for non-singleton services,…
Undistraction
  • 42,754
  • 56
  • 195
  • 331
89
votes
14 answers

Android Service Stops When App Is Closed

I am starting a service from my main Android activity as follows: final Context context = base.getApplicationContext(); final Intent intent = new Intent(context, MyService.class); startService(intent); When I close the activity page by swiping it…
Bam
  • 1,183
  • 1
  • 9
  • 13
88
votes
2 answers

Foreground service being killed by Android

Update: I have not found a true solution to the problem. What I did come up with was a method of automatically reconnecting to a previous bluetooth device anytime the connection is lost. It's not ideal, but it seems to work fairly well. I'd love…
howettl
  • 12,419
  • 13
  • 56
  • 91
88
votes
3 answers

stop service in android

Here I tried simple service program. Start service works fine and generates Toast but stop service does not. The code of this simple service is as below: public class MailService extends Service { @Override public IBinder onBind(Intent arg0)…
Ravi Bhatt
  • 1,930
  • 1
  • 14
  • 27
87
votes
9 answers

Pass data from Activity to Service using an Intent

How do I get data within an Android Service that was passed from an invoking Activity?
GobiasKoffi
  • 4,014
  • 14
  • 59
  • 66
87
votes
10 answers

Is Spring annotation @Controller same as @Service?

Is Spring annotation @Controller same as @Service? I have idea about @Controller which can be used for URL mapping and invoking business logic. while @Service used to annotate service class which contains business logic. Can I use @Controller…
Ketan
  • 2,612
  • 5
  • 31
  • 44
86
votes
3 answers

Android - Getting context from a Broadcast receiver onReceive() to send to

I basically want to make an intent and pass it to a service from my BroadcastReceiver's onReceive(). So far I always used View.getContext(), but here, I'm stuck. How exactly can I get the context so I can use public Intent (Context packageContext,…
madu
  • 5,232
  • 14
  • 56
  • 96