I have a video uploading work that is handled by the work manager. When the user clicks the upload button, I want to show the notification with indeterminate progress bar and when the task starts, show the progress in the same notification.
I passed the notificationID to the work through workData and the progress is shown properly.
The issue is: If there is no internet connection, the indeterminate progress bar is shown and the work is not started (It is enqueued). When I close the app, the indeterminate progress bar is also dismissed and the enqueued task is not shown to the user.
How to make sure the notification persist even on app close or when the work manager has work enqueued to it?
Related
My lead developer chatted with me about an issue we are running into with Flutter. We are building a mobile app and now we have hit a potential issue regarding threading. He said that Flutter by design is normally single thread. He thinks he can get more than one thread to work, but he can't wrap his head around how to get the threads to communicate with each other.
What we need is true background processing where something can be totally handed off to a separate thread to function then no matter where the app is at something can receive a notification from that thread to be able to correctly refresh the UI state.
A simplified example of this is:
User uploads an image
Image gets processed in a different thread
Badge shows up saying something like "image is processing"
Image processing thread gets completed
Badge goes away
The badge / UI thread would have to be send something from the image processing thread in this example. How could we tackle this with Flutter?
You can use isolates with send port and receive port to communicate between the Ui thread and the isolate.
Flutter Isolate Example
Here is a greater plugin to help you use plugins in an isolate flutter_isolate: ^2.0.0
I am using Twilio Taskrouter for making reservations for a video call. What I want is to notify the user that all workers are currently busy, with a message displayed for the user on the browser. So I wanted to know how can one catch the task.canceled event in the browser so that I can notify the user about the task getting canceled due to the task timeout. I have seen the JS SDK for Twilio but I only saw events for Workers, Workspace and Task Queues and couldn't find any such events for Tasks, so is there anyway I can listen to the task's events on the browser side?
I think there is a way to get the assignment status of the task, more details can be found here: TaskRouter Task Resource. On this page look for assignmentStatus resource property. The current status of the Task's assignment. Can be: pending, reserved, assigned, canceled, wrapping, or completed
let me know what you think.
I have a background task for a UWP which can be triggered once a push notification occurs, but I want to trigger the task for normal toast notifications activated when the App is in background.
I found that ToastNotificationActionTrigger can do so but it can only trigger the BG task when the activation type is set to background for that notification.
Is there a work around for differentiating when a toast notification is received and activated with App in BG with that of a toast notification activated in Foreground.
ToastNotification class has an Activated event so you can attach an event handler once you create it to receive Activation events without a background task.
Occurs when user activates a toast notification through a click or
touch. Apps that are running subscribe to this event.
In order to receive activation events from toasts that are created by previous instances of the app, you also need to enumerate current toast notifications on app launch using the ToastNotificationManager class and attach an event handler to them as well.
I have developed a internet explorer toolbar in VC++,In which user needs to log-in then i just update that user details in a menu but whenever i change the tab ,the toolbar gets log-out.
How can i stop running separate instance of toolbar for each tab.
Toolbars are in-process COM servers and IE itself uses process isolation for tabs. To make your state data survive a tab close/crash you need to move it out of IE's processes and into a broker process. You can get the state data by asking the broker process via one of interprocess communication methods (e.g. named pipe).
To sync the state between tabs, save the data to the broker process in old tab's DWebBrowserEvents2 ::WindowStateChanged event handler and ask the broker process for the state data in the new tab's DWebBrowserEvents2 ::WindowStateChanged event handler.
I made an jsf application.This application has a menu containing start,stop buttons.When start is pressed , application starts to get data from web sites, and updates its database.The application also has progress bar for update process.However,this process takes a long time to finish.I want that when i close my browser , it should go on updating database.Besides, when i open it again, i should get previous state.However, this isn't happening.When i close browser the application closes too.How do i do that?
Thanks.
In my case, I would not extend the session life. Instead, create a task and add the object that performs the task into a Queue in an #ApplicationScoped bean and save in database (or any other place) the user that started the job and the status of the job.
When the user logs off (manually logging off or closing the web browser), the task will still be executed because is managed by the whole application (not by a request nor user session). When the user logs in again, he/she could ask to this application queue about the status of the task.
You will need (at least):
An #ApplicationScoped managed bean that will contain and handle the tasks.
A way to handle and execute one or more tasks at the same time. This could be achieved with a ExecutorService or similar technologies. Note: don't dare to manually start new threads by your own, this will only lead to kill your web application server.
An structure to map the user with the tasks he/she has started. It could be mapped with a Map<String, List<Task>> in order that a single user could have more than 1 task at the moment. It would be better to save this in a database (or similar) in order to have a log for these tasks that don't reside in memory. You can even design this in order that if you undeploy the web application or the server suddenly shut downs, you could restart the tasks at hand from a savestate point.