Questions tagged [android-service]

A Service is an application component representing either an application's desire to perform a longer-running operation while not interacting with the user or to supply functionality for other applications to use.

A Service is an application component representing either an application's desire to perform a longer-running operation while not interacting with the user or to supply functionality for other applications to use. Each service class must have a corresponding declaration in its package's AndroidManifest.xml. Services can be started with Context.startService() and Context.bindService().

Android Service Class Reference

Tutorials & Examples

6696 questions
2
votes
1 answer

Using a Service to create a timer that runs even if the app is minimized?

I seem to have a hard time getting a straight answer on this so I'll make a more pointed question. I want to create a timer that is start/stop/pause/resettable. If the timer is active, it should continue to be active even if I go somewhere else in…
2
votes
2 answers

Is this a good idea to create a service to make all the hard work for the activity?

Is this a good idea to create a Service that make all the hard work for the Activity. IE, the Activity will just care about the interface and for calling the services, and other functionalities it must need, and the service will be the 'tool' that…
rogcg
  • 10,451
  • 20
  • 91
  • 133
2
votes
1 answer

Pass context to JobService Android JobScheduler

I am building an app where I store the url and Json in my local SQLite db and then schedule a JobService. In the JobService, I take out all the requests one by one from the db and execute them. Once they are executed, I get the response inside the…
The Bat
  • 1,085
  • 1
  • 13
  • 31
2
votes
1 answer

NotificationListenerService called before Application.onCreate code

I have a NotificationListenerService implementation in my app. It seems that certain things that I initialize in my Application class are not initialized when my NotificationListenerService runs. Also, crashes are not coming into Crashlytics, but…
2
votes
1 answer

How to start an android service when the system boots up?

I want to start an Android service when the system boots up. I already read how to start an app here: http://dannywind.nl/auto-start-delphi-xe5-android-app-after-boot/ but me i don't want to start an app but a service. how to do it ? I m under…
zeus
  • 12,173
  • 9
  • 63
  • 184
2
votes
1 answer

Android service connection leaked after starting new activity

I am trying to figure out why my service is leaking from my application. The official error I am getting is that the Service is not registered any longer. Here's what works: I create a service which creates a listener, when the listener is triggered…
Kevin
  • 127
  • 1
  • 7
2
votes
1 answer

Can IntentService and Service run on the same time?

I am developing an Android application where my SQLite database is inserted multiple times by Service and IntentService. I start my Service right after application is started in MainActivity. My MainActivity has few tabs with fragments. One of the…
Kirk_hehe
  • 449
  • 7
  • 17
2
votes
0 answers

How can I call an IBinder android service from JNI

How can I call an IBinder service (lets say IPackageManager) from JNI and parse the Parcel returned by the method? For example I want to call what should be the same from adb to: adb shell service call package 62 s16 "application.package.id" Where…
2
votes
1 answer

Android MVP with EventBus and Started Service

Context I've written an Android App to play single media file with its lyrics being displayed in the activity. The Activity screen also has a Play-Pause toggle button and a seek-bar to forward/rewind using drag. And the Activity launches the Started…
2
votes
0 answers

Qt Android Service : How to keep service running when screen is turned off + USB cable not connected?

Why doesn't the service work all the time in the background when the screen is off + USB not connected? Using Qt, I created a test android service that uses QTimer to issues Push-notifications every 5-seconds. I did this to monitor whether the…
Mena
  • 3,019
  • 1
  • 25
  • 54
2
votes
1 answer

Why is onDestroy() being called as soon as Intent Service Starts?

I know that a Intent Service ends as soon as it's work is complete. I am making network calls on onHandleIntent().The service dies as soon as it starts but the network calls complete successfully. Is it because all the methods for network calls are…
2
votes
2 answers

Android: service for gps / sensor logging

I m looking for the best practice to implement a service for logging gps- or other sensor-values periodically (every 10-60 sec). The service should deal with the standby mode, when the phone goes asleep. Any help (pseudo-code or tutorials) is very…
Huck Finn
  • 191
  • 3
  • 12
2
votes
0 answers

What happens when a Android Service ( which is delivered as part of a .aar to multiple apps), is started by multiple apps?

I have a .aar which has a android service ( named CommonService ) packaged in it. The .aar is delivered to two apps. Each app will perform startService() on this service. Will there be two instance of the service running ? Following logs ( taken by…
2
votes
2 answers

Android: is it possible to use Firebase Remote Config in a background service?

I would like to use Firebase Remote Config in a background service (that I used to display notifications). Is it possible to do this ? To be more accurate, is it possible to fetch the remote values in a background service ? // Code below in a…
toto_tata
  • 14,526
  • 27
  • 108
  • 198
2
votes
1 answer

QT Android: Can't create android service in separate .so

I was able to find a code that creates a service for android using Qt in this link: https://github.com/bbernhard/qtandroidservices_example However, when i tried to put the service code in another .so file using this…
Mena
  • 3,019
  • 1
  • 25
  • 54
1 2 3
99
100