service interview questions

Top 15 service interview questions

23016 Jobs openings for service

Trying to start a service on boot on Android

I've been trying to start a service when a device boots up on android, but I cannot get it to work. I've looked at a number of links online but none of the code works. Am I forgetting something?


    android:label="StartServiceAtBootReceiver" >
        <action android:name="android.intent.action._BOOT_COMPLETED" />

    android:enabled="true" />


public void onReceive(Context context, Intent intent) {
    if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) {
        Intent serviceLauncher = new Intent(context, RunService.class);
        Log.v("TEST", "Service loaded at start");


Source: (StackOverflow)

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).

Source: (StackOverflow)

How can I access a service outside of a controller with Symfony2?

I'm building a site that relies quite heavily on a third party API so I thought it would make sense to package up the API wrapper as a service, however I'm starting to find instances where it would be useful to have access to it outside of a controller such as in an entity repository. Also related to that is it would be useful to be able to get access to config values outside of a controller (again such as in an entity repository).

Can anyone tell me if this is possible and if not is there a suggested approach to doing this kind of thing?

thanks for any help

Source: (StackOverflow)

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 after the service is installed by going to the Services management console and changing the settings on the recovery tab of the service's properties, but is there a way to do it during the install?

Service Property Recovery Tab

Source: (StackOverflow)

.aspx vs .ashx MAIN difference

what are the differences between .aspx and .ashx pages. I use ashx now when I need to handle a request that called from code and return with a response. but I still want more technical answers please.

Source: (StackOverflow)

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 on the player state).

I know that I can bind the service to the activity using onBind(), but if I understand correctly this will stop the service if the activity is killed. I want to continue the playback even if the user exits the activity. Is there any standard or preferred way of dealing with this problem?

Source: (StackOverflow)

android start activity from service


public class LocationService extends Service {

    public void onStart(Intent intent, int startId) {
        super.onStart(intent, startId);
        startActivity(new Intent(this, activity.class));

I launched this service from Activity

In Activity if condition satisfies start

startService(new Intent(WozzonActivity.this, LocationService.class));

from my LocationService mentioned above could not launch Activity, how can I get context of current running Activity in service class?

Source: (StackOverflow)

How to automatically start your service after install?

How do you automatically start a service after running an install from a Visual Studio Setup Project?

I just figured this one out and thought I would share the answer for the general good. Answer to follow. I am open to other and better ways of doing this.

Source: (StackOverflow)

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, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'"

I tried this --> aspnet_regiis.exe -iru which I found in a lot of forums and it didn't solve my problem.

Does anyone know another method ?

Source: (StackOverflow)

Sending a notification from a service in Android

I have a service running, and would like to send a notification. Too bad, the notification object requires a context, like an Activity, and not a service.

Do you know any way to by pass that ? I tried to create an Activity for each notification bu it seems ugly, and I can't find a way to launch an Activity without any view.

Source: (StackOverflow)

Spring Boot application as a Service

How to configure nicely Spring Boot application packaged as executable jar as a Service in linux system? Is this recomended approach, or should I convert this app to war and install into Tomcat?

Currently I can run Spring boot application from screen session, what is nice, but requires manual start after server reboot.

What I'm looking for is general advice/direction or sample init.d script, if my approach with executable jar is proper.

Source: (StackOverflow)

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 to do that (like the one I suggested above)?

Source: (StackOverflow)

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?

Source: (StackOverflow)

Should a RESTful 'PUT' operation return something

I was wondering what peoples opinions are of a RESTful 'PUT' operation that returns nothing(null) in the response body?

Source: (StackOverflow)

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

What is the best way to deploy node.js? I have a Dreamhost VPS (thats what they call a vm) and I have been able to install node.js and setup a proxy. This works great as long as I keep the ssh connection that I started node with open.

Source: (StackOverflow)