BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 10-29-2008, 07:24 PM   #1
harrywynn
New Member
 
Join Date: Oct 2008
Model: 8300
PIN: N/A
Carrier: AT&T
Posts: 2
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, 03:16 AM   #2
egalexe
Knows Where the Search Button Is
 
Join Date: Feb 2007
Model: 9000
Carrier: SFR
Posts: 48
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, 05:48 AM   #3
robinShazam
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
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, 09:01 AM   #4
harrywynn
New Member
 
Join Date: Oct 2008
Model: 8300
PIN: N/A
Carrier: AT&T
Posts: 2
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



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Vintage MAC Knife Japan 4.75

Vintage MAC Knife Japan 4.75" Folding Lock Blade Knife Chef Pocket Knife Utility

$224.99



Vintage MAC Tools UVEX Adjustable Safety Glasses Motorcycle Mechanic Lawnmower picture

Vintage MAC Tools UVEX Adjustable Safety Glasses Motorcycle Mechanic Lawnmower

$55.24



Vintage Mac Tools USA 10” Adjustable Wrench AJC10 Forged USA picture

Vintage Mac Tools USA 10” Adjustable Wrench AJC10 Forged USA

$14.48



Vintage Mac Tools AW343 Series 1/2 Pneumatic Impact Driver  picture

Vintage Mac Tools AW343 Series 1/2 Pneumatic Impact Driver

$40.00



Vintage Mac Warehouse  3.5” Floppy Disk Solar Powered Calculator Company Swag picture

Vintage Mac Warehouse 3.5” Floppy Disk Solar Powered Calculator Company Swag

$74.00



Vintage VTG A. W. Mack 122387 Large Industrial Fuse Puller 100 Amp - 600 Amp picture

Vintage VTG A. W. Mack 122387 Large Industrial Fuse Puller 100 Amp - 600 Amp

$104.99







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