How can i run my GPS application in background?

前端 未结 2 1393
面向向阳花
面向向阳花 2021-01-04 19:08

I want to send my current location to php web service after every 5 min even if my application is runing in background. I try to make this thing but its working good when my

2条回答
  •  甜味超标
    2021-01-04 19:52

    By "running in background", do you mean running when under the lock screen? If this is the case, then you need to set PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;

    The post Running a Windows Phone Application under the lock screen by Jaime Rodriguez covers the subject well.

    However, if you're talking about running an application that continues to run while the user uses other applications on the device, then this is not possible. In the Mango build of the operating system you can create background agents, but these only run every 30 minutes and only for 15 seconds as described on MSDN.

    There is a request on the official UserVoice forum for Windows Phone development to Provide an agent to track routes, but even if adopted, this would not be available for quite some time.

提交回复
热议问题