BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 10-29-2008, 08:24 PM   #1 (permalink)
New Member
 
Join Date: Oct 2008
Model: 8300
PIN: N/A
Carrier: AT&T
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default HTTP Connections

Please Login to Remove!

I have an application that uses a javax.microedition.io.HttpConnection to connect and get data from/post data to a Google API. This application works perfectly fine in multiple simulators running OS 4.2, 4.3 and 4.6, as well as my personal device (8300 running OS 4.2). I have had quite a few users contact me saying that as soon as they try and do anything within the application that requires a connection it does nothing, nor can they see any form of network activity. It appears that the application is making no attempt to connect at all, and failing right away. Other applications installed that take advantage of the network function as expected. All of these users are on BIS, whereas my personal device is on a BES.

Would being on BES vs. BIS make any difference in regards to connections? Do the simulators emulate a BES while using MDS? Is there another class/method I should be using to make my connections?

Thanks in advance for any insight/assistance.
Offline  
Old 10-30-2008, 04:16 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Feb 2007
Model: 9000
Carrier: SFR
Posts: 48
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

From what I remember there is some difference in coding socket connection when you are connecting to a bes or a bis.

Perhaps make some investigation around that:
(StreamConnection) Connection.open("socket://" + my_server + ":" + my_port + ";deviceside=true", Connectore.READ_WRITE, true);
You ll see that a parameter (deviceside=true) have been added.

I am also wondering if bis user wouldn t have to configure there APN manually.
Offline  
Old 10-30-2008, 06:48 AM   #3 (permalink)
Knows Where the Search Button Is
 
robinShazam's Avatar
 
Join Date: Oct 2008
Location: london, uk
Model: 8120
OS: 4.3.0.67
PIN: N/A
Carrier: Lots
Posts: 15
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Do you get any exceptions? I have seen IllegalArgumentException thrown by Connector.open when not specifying a valid ;ConnectionUID=<whatever> - maybe you are getting that? This was using plain HTTP and on 8120 and 8310 handsets. Specifying ;deviceside=<whatever> was not enough to open a connection.
Offline  
Old 10-30-2008, 10:01 AM   #4 (permalink)
New Member
 
Join Date: Oct 2008
Model: 8300
PIN: N/A
Carrier: AT&T
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

It was indeed due to not specifying a valid ConnectionUID. After I appended it to the URL it worked right away. Thanks for pointing me in the right direction!

Here's a function I came across that I'm using to determine whether or not that is necessary. I thought it may be helpful in case someone comes across this post with the same problem.


Code:
import net.rim.device.api.servicebook.ServiceBook;
import net.rim.device.api.servicebook.ServiceRecord;

private String appendConnectionString() 
    {
        ServiceRecord[] ippprecordArray = ServiceBook.getSB().findRecordsByCid("IPPP");
        if (ippprecordArray == null) {
            return ";deviceside=true";
        }

        int numRecords = ippprecordArray.length;
        for (int i = 0; i < numRecords; i++) 
        {
            ServiceRecord ipppRecord = ippprecordArray[i];

            if (ipppRecord.isValid()) 
            {
                if(ipppRecord.getName().equals("IPPP for BIBS"))
                {
                    return ";deviceside=false;ConnectionUID=" + ipppRecord.getUid();
                }
            }
        }
        return ";deviceside=true";
    }
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.