我想知道是否有可能(实际上应该)每隔几分钟运行一段代码,即使用户正在使用该应用程序。 这背后的基本理念是用户将智能手机与我的应用程序加载在现场并开始收集数据,而他正在收集数据或玩应用程序的其他选项手机捕获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.
更多推荐
发布评论