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.

22142 questions
493
votes
11 answers

Should a RESTful 'PUT' operation return something

I was wondering what people's opinions are of a RESTful PUT operation that returns nothing (null) in the response body.
AwkwardCoder
  • 22,434
  • 24
  • 80
  • 143
479
votes
10 answers

AngularJS : Initialize service with asynchronous data

I have an AngularJS service that I want to initialize with some asynchronous data. Something like this: myModule.service('MyService', function($http) { var myData = null; $http.get('data.json').success(function (data) { myData =…
testing123
  • 10,987
  • 10
  • 42
  • 59
308
votes
30 answers

Context.startForegroundService() did not then call Service.startForeground()

I am using Service Class on the Android O OS. I plan to use the Service in the background. The Android documentation states that If your app targets API level 26 or higher, the system imposes restrictions on using or creating background services…
NiceGuy
  • 3,116
  • 2
  • 7
  • 10
269
votes
13 answers

How to check if a particular service is running on Ubuntu

I do not know the service's name, but would like to stop the service by checking its status. For example, if I want to check if the PostgreSQL service is running or not, but I don't know the service's name, then how could I check its status? I know…
abcd
  • 3,086
  • 2
  • 16
  • 13
245
votes
22 answers

How to check if Location Services are enabled?

I'm developing an app on Android OS. I don't know how to check if Location Services are enabled or not. I need a method that returns "true" if they are enabled and "false" if not (so in the last case I can show a dialog to enable them).
Meroelyth
  • 4,804
  • 9
  • 38
  • 49
229
votes
10 answers

startForeground fail after upgrade to Android 8.1

After upgrading my phone to 8.1 Developer Preview my background service no longer starts up properly. In my long-running service I've implemented a startForeground method to start the ongoing notification which is called in on…
Rawa
  • 10,673
  • 6
  • 33
  • 52
214
votes
3 answers

Starting ssh-agent on Windows 10 fails: "unable to start ssh-agent service, error :1058"

When I try to start the ssh-agent on Windows 10 via PowerShell (with elevated right or without) by entering Start-Service ssh-agent I get the error unable to start ssh-agent service, error :1058 When I check of the service is running via…
quervernetzt
  • 5,739
  • 4
  • 17
  • 36
203
votes
20 answers

Spring Boot application as a Service

How to configure nicely Spring Boot application packaged as executable jar as a Service in the Linux system? Is this recommended approach, or should I convert this app to war and install it into Tomcat? Currently, I can run Spring boot application…
MariuszS
  • 27,972
  • 12
  • 103
  • 144
200
votes
6 answers

Call to getLayoutInflater() in places not in activity

What does need to be imported or how can I call the Layout inflater in places other than activity? public static void method(Context context){ //this doesn't work the getLayoutInflater method could not be found LayoutInflater inflater =…
Lukap
  • 29,596
  • 60
  • 146
  • 239
196
votes
16 answers

How do I run a Node.js application as its own process?

What is the best way to deploy Node.js? I have a Dreamhost VPS (that's what they call a VM), and I have been able to install Node.js and set up a proxy. This works great as long as I keep the SSH connection that I started node with open.
respectTheCode
  • 40,233
  • 16
  • 70
  • 84
188
votes
13 answers

Android: How can I get the current foreground activity (from a service)?

Is there a native android way to get a reference to the currently running Activity from a service? I have a service running on the background, and I would like to update my current Activity when an event occurs (in the service). Is there a easy way…
George
  • 3,587
  • 8
  • 28
  • 47
183
votes
5 answers

How SID is different from Service name in Oracle tnsnames.ora

Why do I need two of them? When I have to use one or another?
Georgy Bolyuba
  • 7,935
  • 7
  • 26
  • 34
176
votes
8 answers

Difference between targetPort and port in Kubernetes Service definition

A Kubernetes Service can have a targetPort and port in the service definition: kind: Service apiVersion: v1 metadata: name: my-service spec: selector: app: MyApp ports: - protocol: TCP port: 80 targetPort: 9376 What is the…
Jacob
  • 3,102
  • 4
  • 37
  • 77
152
votes
9 answers

Where should @Service annotation be kept? Interface or Implementation?

I'm developing an application using Spring. I'm required to use the @Service annotation. I have ServiceI and ServiceImpl such that ServiceImpl implements ServiceI. I'm confused here as to where should I keep the @Service annotation. Should I…
TheKojuEffect
  • 17,034
  • 16
  • 77
  • 113
147
votes
5 answers

How do I update the notification text for a foreground service in Android?

I have a foreground service setup in Android. I would like to update the notification text. I am creating the service as shown below. How can I update the notification text that is setup within this foreground service? What is the best practise…
Luke
  • 5,895
  • 11
  • 54
  • 84
1
2 3
99 100