Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Blackberry 黑莓的互联网问题_Blackberry - Fatal编程技术网

Blackberry 黑莓的互联网问题

Blackberry 黑莓的互联网问题,blackberry,Blackberry,我正在开发一款黑莓应用程序,用于通过互联网发送信息。我已经成功地完成了这个项目,但现在我在检查网络连接时遇到了“错误”,即使网络连接可用 我已经关闭了http连接。但问题仍然存在 有时它工作正常,但过了一段时间它就会抛出错误” 一句话,这不是互联网连接 请帮帮我 这是我的密码 InputStream in=null; int rc=0; HttpConnection http=null; ConnectionFactory factory = new ConnectionFactory(); t

我正在开发一款黑莓应用程序,用于通过互联网发送信息。我已经成功地完成了这个项目,但现在我在检查网络连接时遇到了“错误”,即使网络连接可用

我已经关闭了http连接。但问题仍然存在

有时它工作正常,但过了一段时间它就会抛出错误”

一句话,这不是互联网连接

请帮帮我

这是我的密码

InputStream in=null;
int rc=0;
HttpConnection http=null;
ConnectionFactory factory = new ConnectionFactory();
try{
String u="my url goes here";deviceside=true";
ConnectionDescriptor descriptor = factory.getConnection(u);
http = (HttpConnection)descriptor.getConnection();
in = http.openDataInputStream();
rc = http.getResponseCode();
if (rc != HttpConnection.HTTP_OK) {
    Dialog.inform("Please Check The Internet Connection ");
}
int ch;
while  ( (ch = in.read())!= -1){
    buff3.append( (char) ch);
}
Dialog.inform(" Your Balance Is \n " +buff3.toString() );
buff3.delete(0,buff3.toString().length());
//  buff3=new StringBuffer();
//stringItem.setText(" Your Balance Is \n " +buff.toString());
}
catch(Exception o){
    Dialog.inform("Please Check The Internet Connection ");
    buff3.delete(0,buff3.toString().length());
}
finally
{
    try {
        if(in != null)
        in.close();
            if(http != null)
             http.close();
           buff3.delete(0,buff3.toString().length());
    } catch (IOException ex) {
            ex.printStackTrace();
    }
}   

你是在模拟器上运行还是在真实设备上运行?下面是我的代码,我的应用程序经过了很好的测试,我正在blackberry curve上运行。@AzharAlam仍然没有代码。编辑您的问题并添加相关代码。不要在注释中添加代码。我已经添加了代码,请检查它