views:

358

answers:

2

hi friends i'm a newbie in blackberry programming and have managed to make a small application... The application downloads an xml file through http and parses it and displays it on the screen... now the problem is that though it works fine on my simulator... the client complains that he's getting an error in connection if he connects it through 3G... do i need to add anything other than the following...

        // Build a document based on the XML file.
        url = <my clients url file>;
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();
        hc = (HttpConnection)Connector.open(url+";deviceside=true");
        hc.setRequestMethod(HttpConnection.GET);
        InputStream inputStream = hc.openInputStream();
        hc.getFile();
        Document document = builder.parse(inputStream);
        hc.close();
        inputStream.close();

Do i need to add anything to make it download http content through 3G also??

+3  A: 

Specifying "deviceside=true" requires the device have the APN correctly configured, or you include APN specification in the URL. Have a look at this video.

Richard
+2  A: 

You need to be able to detect what sort of connection the device is using as was said above deviceside=true works only for APN. If you want to just test it out try using

;deviceside=false //for mds

;deviceside=false;ConnectionType=mds-public //for bis-b

;interface=wifi //for wifi

D Yashkir