Complete Task After Quit (Prevent Stopping Task when app Quit) - xamarin

I want yo make a task which complete running after Quit the app. Like complete Downloading Task. I don't find active way or method for Xamarin form mobile app. Any Help?

All You Want to Do is You Want your Task Run in Background so Even if you Quit the App the Task continues to Run is it okie ?
This Type of Task Are Known As Services(Back ground Tasks,or Background Services) in .net And Xamarin PlatForms
I Think You will Find This link Helpfull
See this : enter link description here
in this Way if you are running Some Downoading Task then it will not be killed After App is Getting quit or onSleep and will keep running in Back Ground Until Its Completed Or Any Error Generate ..

First, if you want to make the app still be running after quitting, It can not be realized.
Second, if you want to make the app quit after finishing the task you can refer to the How to terminate a Xamarin application?

Related

Running settimeout in the background

Why doesn't settimeout/debounceTime work when the app is minimized? Events are still being triggered, but I was wondering if there is a way to make timers work while the app is backgrounded.
As soon user leaves your app, the system will stop it from running to reduce battery usage.
If you like your app to execute in background, you must use the appropriate options in the desired platform (Background Task / Fetch in iOS | Background services in Android).

Prevent Shoes App Closed

I am currently building a simple App like an install wizard. At some steps the app will call an external batch script/bash script to execute some tasks on a separate Thread. I don't want the app be closed by the user during the external task execution. Is there any way to listen to the exit button of the window and prevent the event being processed?
There is no such method as of now as far as I can tell (and I maintain Shoes 4). However, I added an issue in the issue tracker.

Word COM in scheduled task on Windows Server

I have an application that uses COM to automate Word. It needs to run even when a user is not logged in. I achieved this on Windows 7 by making it run as a scheduled task which runs at startup and doesn't require a user to be logged on. I also had to use the 'hack' where you add a 'Desktop' folder in 'C:/Windows/SysWow64/config/systemprofile'.
I tried this same method in Windows Server 2012, but it doesn't work. I can see in the task scheduler that the application is starting an instance of Word. However, it then appears to 'hang' and nothing happens. I think perhaps the invisible instance of Word is showing an error message which causes the whole thing to hang, as I cannot dismiss the message.
Has anyone else had trouble getting COM to work on windows server? Is there any way of showing hidden instances of Word to see if an error dialog is showing? Or any other way of diagnosing what the problem is?
I know ideally we would have an app that created the word documents without using COM, but this is not an option at the moment.
Does your app work when run as a logged-in user?
In the past I've run into what sound like similar problems, when running programs that try to use COM interfaces; some tasks work, but others simply don't function unless run as a logged-in user with an interactive desktop.
For me the simplest solution was to set up the machine to log in as a user at boot (which you can set up in the control panel - or I think there might also be a sysinternals tool that supports configuring that nowadays), then make sure that task scheduler/Jenkins/whatever you use launches the app as the logged-in user.

about Task Manager on Windows Phone

I'm developing a windows phone app, suppose my app is running, user click start key, my app will bring to background, then next user long press back key, the task manager will be shown. My question is here: How can update the screenshots of my app when it was brought to background? I don't want expose anything of my app outside even in the task manager, could I do it? Thanks.
How can update the screenshots of my app when it was brought to background?
You cannot. And it's not a task manager, but a "fast app switch", allowing the user to easy swap between applications. The screenshot you see, will be the last screen of your application when it was in the foreground.
And your application will not be running in the background.
No - you cannot change the image shown in the app switching UI. This is built in OS functionality.

Getting blank (black) screenshot with automated screen capture using task scheduler

I am trying to troubleshoot a software bug in which we think an app may not be launching every time it is called. To test this, I created a series of scheduled tasks to launch the app, take a screenshot, and then close the app. These tasks are all run through .bat files.
Everything works fine except for the screenshots. When run as a scheduled task, the .jpg from the screen capture always shows a black box. If I execute the .bat file normally, the screenshot looks fine.
I am using nircmd to send the screen capture command and save it to a folder. The command I am using is as follows:
nircmd.exe savescreenshot "C:\File Path\"~$currdate.MMddyyyy$-~$currtime.HHmmss$.jpg
I am using Windows 7.
The task created is probably running in its own logon session, even if it is running as the same user.
Make your scheduled task run as the currently logged on user.
Keith Brown wrote an old but still valid detailled explaination of the logon session SID. The relevant part is at the middle, under "http://www.microsoft.com/msj/0599/security/security0599.aspx"
You can also poke around the access rigths with EnumWinStaGui.

Resources