PyS60:一个始终运行的应用程序..挂起电话用户界面? (如何解决这个问题?)
我正在 Symbian S60 平台上的 Python Shell 中测试我的应用程序。
从功能上讲,该应用程序在 shell 上运行得很好..但它似乎如此挂起界面?
即使:它不包括繁重的处理!!
循环看起来像:
while 1:
// Application Functions called here.
// Nothing processor intensive but has to run all the time.
// It basically needs to track the phone and remain connected to the web over GPRS !
time.sleep(5)
建议质量应用程序如何执行它的方式..因为质量很重要!
我必须继续进行最终的应用程序,但是这样我的简单应用程序就会破坏手机的可用性。
那么,我肯定做错了什么? 这是什么。。请帮忙!!
I am testing my application in the Python Shell on Symbian S60 Platform.
Functionally, the application just runs great on the shell.. but its seems so hang the interface ?
Even when : It does not include heavy processing !!
The loop looks like :
while 1:
// Application Functions called here.
// Nothing processor intensive but has to run all the time.
// It basically needs to track the phone and remain connected to the web over GPRS !
time.sleep(5)
Suggest the way how the Quality Applications do it.. Because Quality matters !!
I have to proceed to the final application, but this way my simple application will kill the usability of the phone..
So, I am definitely doing something wrong ?
What is it.. Please Help !!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您通过调用本机 python sleep 来阻止进程调度程序切换到 UI 线程。它并不像您想象的那样在 PyS60 上执行。您应该使用 e32.ao_yield 或 e32.Ao_timer 来管理应用程序循环。小心 RTFM,否则您将不会获得任何响应式 UI。
You are preventing the process scheduler from switching to UI thread by calling the native python sleep. It doesn't do what you think it does on PyS60. You should use e32.ao_yield or e32.Ao_timer to manage application loop. RTFM carefully or you won't get any responsive UI.