代码之家  ›  专栏  ›  技术社区  ›  Tejaswi Yerukalapudi

黑莓应用程序在尝试访问服务器时卡住了

  •  0
  • Tejaswi Yerukalapudi  · 技术社区  · 14 年前

            System.out.println("IN ntwk access thread, start point");
            HttpConnection connection = (HttpConnection)Connector.open(serviceURL + WSNAME);
            connection.setRequestMethod(HttpConnection.POST);
            connection.setRequestProperty("Content-type", "application/x-www-form-urlencoded");
            connection.setRequestProperty("Content-length", Integer.toString(postData1.length));
            OutputStream requestOutput = connection.openOutputStream();
    
            requestOutput.write(postData1);
            requestOutput.close();
    
            final int responseCode = connection.getResponseCode();
            if(responseCode!= HttpConnection.HTTP_OK) {
                //Process the error condition
            }
            // Request succeeded process the data.
    

    它似乎被卡住后 connection.getResponseCode() . 有什么方法可以让我确认这个设备出了什么问题吗?

    谢谢,
    特贾

    1 回复  |  直到 14 年前
        1
  •  0
  •   Tejaswi Yerukalapudi    14 年前

    现在,我已经附加了;deviceside=false连接字符串,这使得它在没有黑莓参与的情况下使用运营商的数据服务。