Phonegap应用程序问题 [英] Phonegap application issue

查看:88
本文介绍了Phonegap应用程序问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,超时更新db上的一些数据,从而更改页面相对于数据的视图。该应用程序完美的chrome和firefox上,但是当它运行在设备上的数据不更新,但在数据库更新。也许内存缓存问题?
此行可能有错误?可能$(window)?

  current_user.Set_last_activity 
$(window).bind('onload',setInterval(function(){current_user.Set_last_activity();},5000)
this.check_users_online();
$(window).bind('onload',setInterval(function(){self.check_users_online();},5000)

出现此错误:



<$ pre> 08-20 00:12:57.023:E / SUMAN-statusbarpolicy(1658):
" com.android.systemui.statusbar.policy.StatusBarPolicy 1069& !>
mServiceState.getRoaming()false


解决方案

Cordova应用程序需要声明它们计划从中提取数据的URL。这个已知主机名称列表是白名单。



您的浏览器可能更灵活,但Cordova需要白名单条目。



以下是文档

= Edit =



尝试绑定到您的白名单。 code> deviceready 事件,而不是 onload 事件。


I'm developing an app that on timeout update some data on db and consequently change view on page relative to data. The app works perfectly on chrome and firefox but when it run on device this data doesn't update but on db is update. Maybe memory cache problem? This line maybe has error?Maybe "$(window)"?

current_user.Set_last_activity();
$(window).bind('onload',setInterval(function(){current_user.Set_last_activity();},5000));
this.check_users_online() ;
$(window).bind('onload', setInterval(function(){self.check_users_online();},5000));

in logcat was appeared this error:

08-20 00:12:57.023: E/SUMAN-statusbarpolicy(1658):     
<!>com.android.systemui.statusbar.policy.StatusBarPolicy 1069<!>  
mServiceState.getRoaming()false

解决方案

Cordova applications need to declare what URLs they plan to pull data from. This list of known host names is the "whitelist".

Your browser may be more flexible but Cordova needs the whitelist entry.

Here is the documentation on adding a domain to your whitelist.

=Edit=

Try binding to the deviceready event instead of the onload event.

这篇关于Phonegap应用程序问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆