I want to know whether a Windows Phone application can run in the background or not. I have studied http://msdn.microsoft.com/en-us/library/ff431744(v=vs.92).aspx. There I foun
Your app cannot "really" run in the background. It can hand certain tasks to the operating system, like sending a file, playing music etc. These tasks will be continued by the OS even when your application is not running anymore. But when the user navigates away from your app it basically stops running.
What comes closest to running in the background can IMO be achieved using background agents. The PeriodicTask lets your application run for about 15 seconds about every 30 minutes.
For quite some time (pre-Mango) "running in the background" for WP7 meant running under the lock screen. This is possible. But again, when the user navigates away from your application it stops running.
If you need to talk to your server when the application ends you could do so if it doesn't take long. If I am not mistaken you have about 10 seconds time when your application is deactivated. If you exceed this limit the OS will kill your app.