简体   繁体   English

WM6.5锁定屏幕关闭GPS服务

[英]WM6.5 Lock screen turns off GPS service

I'm developing a GPS tracker For WM6.5 which can receive coordinates with GPS and send it into. 我正在为WM6.5开发GPS追踪器,该追踪器可以使用GPS接收坐标并将其发送到。 All works fine but I have one problem when the screen is locked: packets are sending but GPS does not work (it shows same position) but when I wake up my phone then the GPS starts working again. 一切正常,但屏幕锁定时我遇到一个问题:正在发送数据包,但GPS无法正常工作(显示相同位置),但是当我唤醒手机后,GPS再次开始工作。

How can I can I keep the GPS service running when the screen is locked? 屏幕锁定时如何保持GPS服务运行? I'm testing with a HTC Touch 2 and my solution is written in C#. 我正在使用HTC Touch 2进行测试,而我的解决方案是用C#编写的。 For GPS i'm using the Microsoft.WindowsMobile.Samples.Location library. 对于GPS,我正在使用Microsoft.WindowsMo​​bile.Samples.Location库。

This is probably because the device is going to sleep. 这可能是因为设备即将进入睡眠状态。 If it stays awake, the battery will run down quickly. 如果保持清醒状态,电池将很快耗尽。 Mobile devices are designed to enter a hibernate like state almost immediately so that they last longer on a charge. 移动设备被设计为几乎立即进入休眠状态,从而使它们持续充电的时间更长。

If battery life is of no concern, you could go into the power settings and tell it to never turn off. 如果电池寿命无关紧要,则可以进入电源设置并告诉它永远不要关闭。 However, you risk having a dead device if your battery ever runs out. 但是,如果电池用完了,您可能会面临设备失效的风险。

Windows Mobile devices know different power states.See HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Power... Windows Mobile设备知道不同的电源状态。请参阅HKEY_LOCAL_MACHINE \\ System \\ CurrentControlSet \\ Control \\ Power ...

An application can request a specific minimum power state using SetPowerRequirement API call: http://msdn.microsoft.com/en-us/library/ms920689.aspx . 应用程序可以使用SetPowerRequirement API调用来请求特定的最小电源状态: http : //msdn.microsoft.com/zh-cn/library/ms920689.aspx Instead of specifying which device should not fall below a power reqirement, you can also specify a general requirement for the application: http://www.hjgode.de/wp/2009/07/14/howto-run-an-application-periodically/#more-193 using SetPowerRequirement and SetSystemPowerState. 除了指定哪个设备不应低于电源要求之外,您还可以指定该应用程序的一般要求: http : //www.hjgode.de/wp/2009/07/14/howto-run-an-application-使用SetPowerRequirement和SetSystemPowerState 定期/#more-193

I recommend using SetSystemPowerState, if you want to avoid the device falls into a hibernate mode. 如果要避免设备陷入休眠模式,建议使用SetSystemPowerState。 If you know the GPS port and GUID, you can also use SetPowerRequirement with the device name. 如果您知道GPS端口和GUID,也可以将SetPowerRequirement与设备名称一起使用。

I have no experience with changing the Control\\Power branches to change the behaviour of a device within a named power state. 我没有更改Control \\ Power分支以更改命名电源状态下设备的行为的经验。

You may try SetSystemPowerState with Power_State_Unattended or enable the user to choose for 'keep device ON'. 您可以尝试使用Power_State_Unattended的SetSystemPowerState或使用户选择“将设备保持打开状态”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 wm6.5仿真器无法连接主机上的Web服务 - wm6.5 emulator can not connect web services on the host machine 使用.NET访问HTC wm6.5摄像机 - Access HTC wm6.5 camera using .NET 使用WM6.5设备通过蓝牙以编程方式连接/同步到WMDC - Programmatically connect/sync to WMDC via bluetooth with WM6.5 device WIP6.5仿真器和Windows手持设备6.5(Motorola MC65)上未显示SIP按钮 - SIP buttons not showing on WM6.5 emulator and Windows handheld 6.5 (Motorola MC65) windows mobile 6.5 .net CF - 如何获取内部电话打开或关闭的通知 - windows mobile 6.5 .net CF - how to get notification that the internal phone turns on or off Windows Phone 8.1在锁定屏幕后面记录GPS - Windows Phone 8.1 Recording GPS behind the lock screen Windows Mobile应用程序可以在Professional 6.5仿真器中使用,但不能在WM 6.5设备中使用 - Windows Mobile Appliacation works in Professional 6.5 Emulator but not in WM 6.5 Device 在wm 6.5上自动切换到数字键盘 - Auto switch to numeric keypad on wm 6.5 如何在WM 6.5中创建手指可滚动的文本框? - How can I create a finger scrollable Textbox in WM 6.5? 屏幕关闭时,Android绑定服务被冻结 - android Bound Service gets frozen when screen is off
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM