Always on/Background application Windows Phone 8.1 - background-process

I need my application to run a task in the background. I'd like to know if there is a way to do this without the user having to launch the application first.
Also I need the Background Task to display a page when a condition is reached and this page should take priority over anything else which might be on the screen at that moment.
Any help would be appreciated.

Technically this is not possible in Windows Phone Platform, however you could use BackgroundWorker to perform background tasks.

Related

Set app as default launcher Programmatically

we have an app that is used by providers for TV. We do not have Operator tier yet since there requirements are really high..
The issue we have is we use a commercial Android Tv box provider and they have a similar panel(like tier) for us to manage the device like remote buttons..
In order to facilitate the user experience we need to enable the app as a laucher for Home button to load our application.
But to get to that, we need to enable developer mode and then debug... A big process for common users to manage if they factory reset there boxes..
Also we do not want that dialog to show all the time that asks if we want this application to be set as default laucher..
Is there a way with android 10 and up to have our app as a default laucher?Without playing arround with ADB and developer settings?
Thx!

MS Teams custom tab SSO not working on desktop App

We have set up our application as a custom Microsoft Teams app. The application is working just fine in the browser but fails to load in the Desktop APP. The application uses Azure Active Directory to perform the login through the saml2.0 implementation and is embedded through an iFrame.
Can't find a good way to debug what the issue might be. The AAD logs are always empty and the DevTools do not show what's happening in the embedded iFrame.
Has anyone encountered this issue before or might know of a way to try and debug it?
This is actually quite common, that it works fine in browser but not in desktop, and there are probably several reasons for that, not least of which that the popup experience is easier to control in browser versus the actual Teams desktop sandbox. It's also common, I think, that people try to launch their own popup to handle the login, which you can't actually do in the Teams desktop. It's a bit wierd, but basically Teams desktop launches a popup for you, which loads your login page, which in turn then needs to do a -redirect- because you're now in a new browser page.
In any case, in my experience, it's always because I've done something wrong, that's why desktop doesn't work correctly. My suggestion is to follow the docs -exactly- and it should work fine.
The most important doc is this one, which really does give some quite straightforward step-by-step. You can also check out this video which helps as well.

Execute code in Visual Studio on schedule and automatically

I have web app code in VS2010 that is manually executed every night. One of the developers manually runs the code in VS, when the web page opens, presses a few buttons etc.. and executes the code to get our required results. How can we automate this process so as to eliminate any human element. Ideally, I am looking for a way to have the code execute automatically at a given time during the day. What is involved in getting something like this to work?
A WCF service is a possible solution:
http://msdn.microsoft.com/en-us/library/ms734712.aspx
Windows has scheduled tasks which is good at... scheduling tasks.
Do you (or plan to) have a big test of GUI tests? There are entire tools dedicated to GUI automation testing. I'd recommend looking into one of those if this is going to be a big part of your overall test strategy.
If this is a one-time thing, you could schedule the running of a simple C# application that hosts a Web Browser control, that points to your web site. In this sense, the Web Browser control acts as your browser. You can send JavaScript commands to it etc.
Web Browser documentation:
http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx
Another alternative is to schedule an AutoHotKey script to simulate the key pressing and mouse clicks. This works well. I used to use it to rack up Farmville points (no joke).
http://www.autohotkey.com/
A Windows service seems better in the sense of "scheduled" and "no intervention." A WCF service is still, by default, listening and waiting for interaction (hosting the service). Or just schedule a simple app or script to do what you need.
Can you tell us a little more about this process? My initial recommendation would be to transition that code from a web application into a command line utility and then use windows task scheduler. If for some reason there are heavy dependencies within that web app that make that impossible I would consider taking those button click events and turning them into web services that you could then call programmatically from a command line application.

Should I use a Windows Service or an ASP.NET Background Thread?

I am writing a web application in ASP.NET 3.5 that takes care of some basic data entry scenarios. There is also a component to the application that needs to continuously poll some data and perform actions based on business logic.
What is the best way to implement the "polling" component? It needs to run and check the data every couple of minutes or so.
I have seen a couple of different options in the past:
The web application starts a background thread that will always run while the web application does. (The implementation I saw started the thread in the Application_Start event.)
Create a windows service that is always running
What are the benefits to either of these options? Are there additional options?
I am leaning toward a windows service because it is separated and can run on a different server (more scalable) as well as there is more control over when it is started/stopped, etc. However, I feel like the compactness of having the "background" logic running in the process of the web application might make the entire solution more understandable.
I'd go for the separate Windows service primarily for the reasons you give:
You can run it on a different server if necessary.
You can start and stop it independently of the web site.
I'd also add that it could well have some impact on the performance of the web site itself - something you want to avoid.
The buzz-word here is "separation of concerns". The web site is concerned with presenting the data to the user, the service with checking the integrity of the data.
You can also update the web site and service independently of each other should you need to.
I was going to suggest that you look at a scheduled task and let Windows control when the process runs, but I re-read your question and noted that you wanted the checks to run every couple of minutes. The overhead of starting the process might be too great in this case - though some experimentation would probably prove this one way or the other.
If you use a scheduled task there's also the possibility that you could start the next check before the current one has finished - something you can code for if you're in complete control.
Why not just use a console app that has no ui? Can do all that the windows service can and is much easier to debug and maintain. I would not do a windows service unless you absolutely have to.
You might find that the SQL Server job scheduler sufficient for what you want.
Console application does not do well in this case. I wrote a TAPI application which has to stay in the background and intercept incoming calls. But it did it only once because the tapi manager got GCed and was never available for the second incoming call.

Multiple 'development servers' started by Visual Studio

Occasionally, when performing certain actions in Visual Studio, things seem to go 'haywire' - Visual Studio launches many, many instances of the 'Development Server' - multiple icons appear in the notification area, multiple successive 'toast' notifications pop up etc etc.
Both of the solutions I have this problem with contain two web projects, one of which is set up to use ASP.NET forms authentication.
I am also using the Perforce source control plug-in. These solutions are under source control.
Actions that can prompt this behaviour are things like, creating a content page from a master page, clicking on the 'Configuration' icon at the top of the solution explorer. Ironically, actually running one of the projects doesn't seem to cause the same problems.
Once things have settled down, I end up with a notification area that fills half my taskbar. 'Running' the mouse along these icons then causes them to disappear, in the same way that you sometimes get with applications that have terminated unexpectedly.
This is becoming pretty frustrating as it tends to block things I actually want to do!
Grateful for any advice. Hopefully I've been sufficiently clear - it's not a straightforward issue to describe!
Thanks,
Jamie
Please check out the blog post at http://vishaljoshi.blogspot.com/2009/08/multiple-instances-of-visual-studio.html
Did you check the "Properties" page (right-click of your solution file) of your solution? You should be able to set the starting project there to "Single Startup Project".
Sounds like the Web Configuration service is failing during startup and VS is trying to restart it.
I would either stop using that tool--it always seemed overkill to me once you learn how to manipulate web.config and get your basic user/role admin CRUD pages on the site. But it may just be some bad data in your authentication database, if you're using the built-in Membership providers, etc. If it's development, try using the aspnet_sqlreg.exe (or whatever it's called) to remove and re-create the Membership, Profile, etc. database tables and stored procs.
But first, I would check the Application event logs and see if the exceptions there help you track down the issue.

Resources