Questions tagged [android-intentservice]

The IntentService class provides a straightforward structure for running an operation on a single background thread.

The IntentService class provides a straightforward structure for running an operation on a single background thread. This allows it to handle long-running operations without affecting your user interface's responsiveness. Also, an IntentService isn't affected by most user interface lifecycle events, so it continues to run in circumstances that would shut down an AsyncTask

An IntentService has a few limitations:

  • It can't interact directly with your user interface. To put its results in the UI, you have to send them to an Activity.
  • Work requests run sequentially. If an operation is running in an IntentService, and you send it another request, the request waits until the first operation is finished.
  • An operation running on an IntentService can't be interrupted.

However, in most cases an IntentService is the preferred way to simple background operations.

461 questions
0
votes
1 answer

Intent Service running properly on android 9 when app is in background

I have an Intent service & a BroadcastReceiver. As per background limitation on Android Oreo & above, the background applications(when an application is not foreground ) cannot use the started service. When you call startService() method from the…
0
votes
0 answers

How to run Camera as a background service not in main thread(background thread) in andoid

How to create camera as background service which should be run in other than main thread. When am trying to run through thread handler getting crashed due to windgowmanager which required UI thread. How can i resolve this issue
0
votes
1 answer

Does Android foreground IntentService run in the UI thread or a different thread?

I am making an IntentService. The code is something like this: protected void onHandleIntent(@Nullable Intent intent) { startForeground(NOTIFICATION_ID, buildForegroundNotification()); } private Notification buildForegroundNotification() { …
Wrichik Basu
  • 1,005
  • 17
  • 28
0
votes
1 answer

Service Binder object casting issue during service connection

I have an issue in service connection issue in that line var binder:TwentyFourHoursService.LocalBinder = service as TwentyFourHoursService.LocalBinder and could not find solution: override fun onServiceConnected( className:…
0
votes
0 answers

Can I use WorkManager to implement a use case in Android Java where I need to call API for every 15 minutes and update the UI when app is open?

Should I use WorkManager or is there any other better approach. Also, I want to use Retrofit to call the API every 15 minutes. WorkManager will execute the tasks even if we Kill the app but I only need to call API when the app is open. WorkManager…
0
votes
0 answers

Way to create a notification in Android considering Android O

What I am trying to understand is the way to create a notification that will check the current date of the system(Tablet or Phone) and match the dates that I am getting from the server. The data is JSON data. This will be checked every day and if…
0
votes
1 answer

IntentService not starting automatically after phone reboot unless app is started

I'm trying to send a notification at a particular time, this part works perfectly but after I reboot the phone, the service doesn't get started unless the app is opened which then starts the service. I've tried multiple solutions online but still…
tony
  • 466
  • 6
  • 22
0
votes
1 answer

Android, IntentService vs Custom service with HandlerThread

I have read one post about Android services within threads but there is one thing that I did not understand. In the post the writer uses a custom service because it allows multitasking while IntentService does not.…
0
votes
1 answer

How to run intentservice in kotlin

I am new to Kotlin development. below is an attempt to create an intentservice. i followed some tutorials on the internet but at run time i received the below mentioned error in the logcat. please let me know how can i fix this…
Amr Bakri
  • 11
  • 1
  • 3
0
votes
0 answers

Intent Service blocks UI and causes ANR

I have to download some data as soon as user logs in to the app. I have put -the network calls to download this data and -the database transactions to write it to sqlite in an intent service. The data is huge so, saving it to sqlite is taking…
0
votes
3 answers

Android - how to overcome the 10 second limit when receiving broadcasts from IntentService?

I would like to know, I have an Activity that receives broadcasts from an IntentService that needs to save data and then export it to a CSV file. However, this can take longer than 10 seconds, and I know there are certain problems with starting…
0
votes
2 answers

App not finding external service - why so?

In App A, I have the following code to start a service in App B: public void startAppBService() { PackageManager packageManager = getPackageManager(); Intent serviceIntent = new Intent("com.example.project.appBCommunicator"); …
0
votes
0 answers

error: [Dagger/MissingBinding] androidx.lifecycle.ViewModelProvider.Factory cannot be provided without an @Provides-annotated method

I have read the following articles but I don't know what I am doing wrong. Dagger AndroidInjector cannot be provided without an @Provides-annotated method > cannot be provided without an @Provides-annotated…
0
votes
0 answers

WorkManager Worker class not running after App kills

I am extending the Worker class and in its doWork() method I'm uploading files to the cloud. The app uploads files when it is in foreground, but If I kill the app the doWork process stops. After opening the app again, it starts to run and completes…
0
votes
2 answers

Can multiple service perform work parallelly at the same time

I am developing an app which has multiple features which need to perform work in the background. Each feature needs to run at the same time and perform some work parallelly. Currently, I am using JobIntentService to perform work but I have noticed…
Rahulrr2602
  • 701
  • 1
  • 13
  • 34