后台应用程序运行时的操作(Background Operation when the app is running)

系统教程 行业动态 更新时间:2024-06-14 17:03:54
后台应用程序运行时的操作(Background Operation when the app is running)

我想知道是否有可能(实际上应该)每隔几分钟运行一段代码,即使用户正在使用该应用程序。 这背后的基本理念是用户将智能手机与我的应用程序加载在现场并开始收集数据,而他正在收集数据或玩应用程序的其他选项手机捕获3g / wifi区域,它将启动将数据同步到服务器。 我一直使用Google云端消息传递(GCM)从我的网络服务中向设备发送通知,当它到达手机时,这意味着手机现在连接到互联网我运行了那段为我同步的代码。 它会停止应用程序的当前活动,或者我会说用户是否能够继续收集数据并且同步也在后台运行? 这种情况的任何想法?

多谢你们。

I was wondering if it is possible ( it should actually) to run a piece of code every couple of minutes even if the user is using the app. The basic Idea behind this is that the User will take the smart phone with my app loaded in the field and start collecting data, while he is collecting data or playing with other options of the app the phone catches the 3g/wifi zone it will start syncing the data to the server. I keep pushing notifications to the devices from my web service using Google Cloud messaging (GCM) and when it reaches the phone it means the phone is now connected to the internet I run that piece of code which do the sync for me. Would it stop the current activity of the app or I would say do the user will be able to keep collecting data and the sync is also running on the background?. any idea of this type of scenario?

thanks guys.

最满意答案

与服务器通信的任何内容在ActionScript中本质上是异步的(并且您无法使其同步)。 所以,只需做你通常做的与服务器通信。 其他处理(例如大型集合上的循环或绘制大量对象) 可能会使应用程序无响应 。

Anything that communicates with a server is by nature asynchronous in ActionScript (and you can't make it synchronous). So just do what you'd normally do to communicate with the server. Other processing, such as loops over a large collection or drawing a lot of objects, can make the application unresponsive.

更多推荐

本文发布于:2023-04-24 14:22:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/ecdacd87fb10629bd110602d191d98dc.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   后台   操作   Background   app

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!