无法连接到互联网在Blackberry设备? [英] Unable to connect to internet in Blackberry device?

查看:255
本文介绍了无法连接到互联网在Blackberry设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发展的地方,我使用的浏览器领域加载它的HTML文件的应用程序。我的code是如下:

I am developing an app where i am using browser field to load html files in it. My code is as follows.

Main.java

Main.java

    //pushing screen to browser field page..

public Main()
{        
    // Push a screen onto the UI stack for rendering.
    pushScreen(new WebViewController());
}  

WebViewController.java

WebViewController.java

    BrowserFieldConfig bfConfig = new BrowserFieldConfig();
    bfConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,
            BrowserFieldConfig.NAVIGATION_MODE_POINTER);
    bfConfig.setProperty(BrowserFieldConfig.JAVASCRIPT_ENABLED,
            Boolean.TRUE);
    bfConfig.setProperty(BrowserFieldConfig.ALLOW_CS_XHR, Boolean.TRUE);  
    bfConfig.setProperty(BrowserFieldConfig.INITIAL_SCALE, new Float(0.0));
    bwf = new BrowserField(bfConfig);
    add(bwf);

    UiApplication.getUiApplication().invokeLater(new Runnable() {

        public void run() {
            // TODO Auto-generated method stub
            bwf.requestContent("local:///html/index.html");         
        }
    }, 500, false);    

所有我的服务器code&放; UI设计在JavaScript和放大器; html页面分别从index.html页面调用...

按以下code这是工作(执行)的仿真和放大器;运行期间正从服务器的数据。但是,当我在BlackBerry设备正在运行仅UI设计从index.html页面加载而不是从服务器获取数据。我没有得到任何想法什么的误差。
我启动Javascript在黑莓设备还,但仍然不能正常工作。

As per the following code it is working(executing) in simulator & getting data from server during runtime. But when i am running in BlackBerry device only UI design is loading from index.html page but not getting the data from server. I am not getting any idea whats the error is. I enabled javascript in Blackberry device also but still it is not working..

由于我是新来这个黑莓开发,无法在黑莓设备上运行,同时发现有什么用我的应用程序的问题。

As i am new to this blackberry developing, unable to find whats there problem with my app while running in Blackberry device.

按以下code,我应该添加任何外部code从服务器获取数据(如刚刚在签署后的黑莓设备访问互联网)

在模拟器,它正在好&安培;从服务器获取数据。当BlackBerry设备只主网页UI(index.html中UI)执行加载,但无法从服务器获取数据。

谁能帮我这个......

Can anyone help me with this.....

推荐答案

这问题是问题变化的为什么我有对黑莓连接问题。我会试着给你的想法如何解决这些问题。

This question is variation of questions "Why I have issues with connection on the BlackBerry". I'll try to give you idea how to solve them.

网络连接不像J2ME,Android或iPhone连接复杂得多,你问大部分系统打开TCP / HTTP / UDP连接。 RIM推出网络传输。我不知道原因 - 或者他们想给开发商的功率来选择特定的传输,或者是因为BES管理员/运营商可能会限制一些连接,或其他原因。但副作用是BB显影剂必须指定他要使用的设备上的当前连接其传输。戏剧性的事情,默认连接是直接TCP(通过APN运营商设置)。而直接的TCP完美的作品在模拟器。但在BB设备最常用的连接是BIS-B和WiFi。同时BIS-B是通常的开发商不可用之前,他们刚刚打开给大家最近。

The network connection is much complex unlike j2me, android or iphone connection where you mostly ask system to open TCP/HTTP/UDP connection. RIM introduced Network Transports. I'm not sure about reasons - or they wanted to give developer power to select specific transport, or because BES admins/Carriers could restrict some connections, or other reasons. But side effect that BB developer has to specify which transport he wants to use for current connection on the device. The dramatic thing that default connection is Direct TCP (through the APN carrier settings). And direct TCP works perfect on simulators. But most used connection on the BB devices are BIS-B and WiFi. Also BIS-B was unavailable for usual developer before and they just opened it for everyone recently.

在5.0 OS开发了code量巨大,以确定哪些传输可用的设备上,有循环通过传输试图以开放英寸
RIM推出的<$c$c>ConnectionFactory在5.0的操作系统,它提供标准的机制来打开确定可用传输并打开连接(<一href=\"http://supportforums.blackberry.com/t5/Java-Development/Sample-$c$c-Using-the-ConnectionFactory-class-in-a-BrowserField/ta-p/532860\">example).

Before 5.0 OS developer had huge amount of code to determine what transports are available on the device and there was loop by transports trying to open in in order. RIM introduced ConnectionFactory in 5.0 OS which provides standard mechanism to open determine available transports and open the connection (example).

您总是用连接工厂要打开连接。如果直接通过连接或通过 BrowserField 到达远程主机没关系。你必须使用连接工厂

You always have to use ConnectionFactory where you want to open connection. It doesn't matter if you reach remote host directly through Connector or through BrowserField. You have to use ConnectionFactory.

戏剧性的是,即使你使用它,你不能达到BIS-B运输。正如我提到它仅适用于联盟成员是可用之前。 RIM不限制,现在使用BIS-B任何开发者。但是,我没有看到,他们也给出任何例子。为了让连接工厂开BIS-B则需要<一个href=\"http://stackoverflow.com/questions/11612942/blackberry-bis-option-secret-key-vs-mds-public\">next行:

Dramatic thing is that even if you use it you can't reach BIS-B transport. As I mentioned before it was available only for alliance members. RIM doesn't restrict using of BIS-B for any developers right now. But I don't see that they also give any example. To allow ConnectionFactory to open BIS-B you need next line:

connFact.setTransportTypeOptions(TransportInfo.TRANSPORT_BIS_B,
        new BisBOptions("mds-public"));

这是对黑莓手机的连接只是小总结。但它应该给你正确的方向来解决你的问题。

This is just small summary of connections on the BlackBerries. But it should give you right direction to solve your problem.

这篇关于无法连接到互联网在Blackberry设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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