Question: I have developed a windows phone application and it works fine.It uses GPS and GPRS connection and does some calculations.Now i want it to run in the background or under lock screen until user chooses not to run it under locked screen or in the background.

Any idea how can i do that ?

Answer: 
You're in luck, a new background processing model is supported specificly for GeoLocation apps in WP8.

Further information:

How to run location-tracking apps in the background for Windows Phone 8:
<http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj662935(v=vs.105).aspx>

Apps Tracking GeoLocation in the background:
<http://www.developer.nokia.com/Community/Wiki/What%27s_new_in_Windows_Phone_8>
If you're coding an application for WP users I'd suggest you code it initially to target WP7.5, otherwise your app won't be usable by the existing WP user-base. 

Granted, there are only 14-15 million WP7 users, but I'll bet there are significantly fewer WP8 users. WP7.5 apps run on WP8 and not the other way round!

In the WP7.5 world what you'd want to use is a background agent. This is a process that runs every 15-30 minutes and can do some calcs, connect to the web, etc. Here are some details on it: [Background Agent Info](http://www.silverlightshow.net/items/Windows-Phone-7.5-Use-Background-agents.aspx)