AJAX XML不工作的黑莓手机与网络工程或PhoneGap的 [英] AJAX XML not working on BlackBerry with Web-Works or Phonegap

查看:169
本文介绍了AJAX XML不工作的黑莓手机与网络工程或PhoneGap的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了,它加载从网络上的外部XML文件的统计信息的应用程序。

它工作正常,在Web浏览器。它也能正常工作时,我用的PhoneGap为Android打包。 的黑莓Playbook的工作原理也是如此。

然而,当我打包了黑莓手机无法正常工作。我曾经尝试都WebWorks的命令行工具和PhoneGap的。


当我用打包的WebWorks和模拟器上运行

在Web检查控制台给我的错误

无法加载资源:(错误请求资源)按照500的状态的服务器响应

当我封装的PhoneGap和模拟器上运行

当我打包带的PhoneGap,而不是我的WebWorks得到以下错误坡平了,在警报...

 的差距:网络状态,getConnectionInfo,网络STATUS0,真]

间隙:[设备,getDeviceInfo,设备1,真]

gap_init:

gap_callbackServer:

gap_poll:
 


应用真人版(未编译)

ZIP文件在运行的WebWorks PhoneGap的或


类似回答的问题


问题的YouTube视频黑莓模拟器


我试过

事情

我添加到我的配置文件。

 <获得子域=假的uri =*/>
 

我添加了一个$ .support.cors功能建议通过PhoneGap的

 的$(document).bind(mobileinit,函数(){
    //这里让你的jQuery Mobile框架结构的变化!
    $ .mobile.allowCrossDomainPages = TRUE;
});
 

解决方案

是您的模拟器的WebWorks SDK最新的?

我已经与2.0.1.358和模拟器为2.0.0.7971,没有任何问题,我可以看到测试在真实的PlayBook。

我打包带2.2.0.15的WebWorks对PlayBook的SDK,而我唯一改变的是ID config.xml中,这是不接受与点的打包。


好了,现在我看到的问题是什么。

这是pretty的晦涩难懂,但Java的智能手机模拟人生设置与另一位仿真工具的工作称为MDS模拟器。它不是为大多数事情真的有必要,但提供的网络类似设备看到了一个企业BES环境是什么。模拟器认为它有什么是所谓的MDS连接一切,即使MDS模拟器没有运行的时间。

通过一个的WebWorks应用程序,如果使用了默认的config.xml文件中没有<轮辋:连接> 标记(这完全适用于大多数情况下),它之前,TCP选项优先MDS。这是因为SIM认为它有一个MDS连接时,它实际上并没有,而且连接尝试最终失败。问题

如果您添加的code以下位到你的config.xml文件,它会降低MDS的优先级,并应使其正常工作。

 <轮辋:连接超时=60000>
    < ID> BIS-B< / ID>
    < ID> TCP_WIFI< / ID>
    < ID> TCP_CELLULAR< / ID>
    < ID> MDS< / ID>
    < ID> WAP2< / ID>
    < ID> WAP< / ID>
< /轮辋:连接>
 


和最后一个关键项目 - 你需要设置模拟器使用模拟的WIFI网络。点击主屏幕(由无线指标)的顶部的横幅,然后打开无线网络连接,并在选项和状态点击Wi-Fi网络。然后点击默认的WLAN网络,并通过该步骤关联。

I've built an application which loads statistics from an external xml file on the web.

It works fine in the web browser. It also works fine when I package it with PhoneGap for Android. Works on BlackBerry Playbook as well.

However it doesn't work when I package it for BlackBerry. I have tried both WebWorks Command Line Tool and PhoneGap.


When I Package with WebWorks and Run on Simulator

The console on Web Inspector gives me the error

"Failed to load resource: the server responded with a status of 500 (Error requesting resources.)"

When I Package with Phonegap and Run on Simulator

When I package with PhoneGap instead of WebWorks I get the following errors poping up in alerts...

gap : ["Network Status", "getConnectionInfo","Network Status0",true]

gap: ["Device","getDeviceInfo","Device1",true]

gap_init:

gap_callbackServer:

gap_poll:


Live version of App (uncompiled)

ZIP file to run in WebWorks or Phonegap


similar unanswered question.


Youtube Video of Problem in BlackBerry Simulator


Things I've Tried

I've added to my config file.

<access subdomains="false" uri="*"/>

I've added a $.support.cors function suggested by phonegap.

$( document ).bind( "mobileinit", function() {
    // Make your jQuery Mobile framework configuration changes here!
    $.mobile.allowCrossDomainPages = true;
});

解决方案

Is your simulator and WebWorks SDK up to date?

I've tested on a live PlayBook with 2.0.1.358 and in the simulator for 2.0.0.7971 with no problems that I can see.

I packaged with the 2.2.0.15 WebWorks for PlayBook SDK, and the only thing I changed was the id in config.xml, which wasn't accepted in the packager with the dots.


Okay, now I see what the problem is.

It's pretty obscure, but the Java Smartphones sims are setup to work with another old simulator tool called the MDS Simulator. It's not really necessary for most things, but provides networking similar to what a device sees in a Corporate BES environment. The simulator believes it has what is called an "MDS" connection all the time even if the MDS Simulator isn't running.

With a WebWorks app, if you use a default config.xml file with no <rim:connection> tag (which is totally fine for most cases), it prioritizes MDS before the TCP options. This is a problem because the sim thinks it has an MDS connection when it actually doesn't and that connection attempt eventually fails.

If you add the following bit of code to your config.xml, it will reduce the priority of MDS and should make it work just fine.

<rim:connection timeout="60000">
    <id>BIS-B</id>
    <id>TCP_WIFI</id>
    <id>TCP_CELLULAR</id>
    <id>MDS</id>
    <id>WAP2</id>
    <id>WAP</id>
</rim:connection>


And one last Critical item - you need to set up the simulator to use the simulated wifi network. Click on the top banner of the homescreen (by the wireless indicator), then turn on Wifi, and click on Wi-Fi Network in Options and Status. Then Click on Default WLAN Network and go through the steps to associate it.

这篇关于AJAX XML不工作的黑莓手机与网络工程或PhoneGap的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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