Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
amrishodiq
Posts: 112
Registered: ‎09-23-2009
My Device: Not Specified

Re: BIS Connections

Peter, thanks for these great informations. I need one more help. I received a message from alliancesapplications@rim.com subjected:


RE: BlackBerry Alliance Program Member Application

 

after signed up as Alliance Member, is that means that I'm now a RIM's Alliance Partner? And then is it means I can apply for BIS-B for my application? If that so, can you give us some more usefull information on how to apply for BIS-B for my application, such as a link to the application form? I search anywhere in the http://partners.blackberry.com/ but never found it yet.

 

Thanks in advance.


Please use plain text.
New Developer
sagan
Posts: 3
Registered: ‎11-14-2009
My Device: Not Specified

Re: Connecting your BlackBerry - http and socket connections to the world

Peter/Mark,

In addition to all the suggested methods (MDS, WAP2, BES, BIBS), I am ALSO using the method of ";deviceside=true;apn=X", where X is carrier specific.

 

Is there a way via java/code/api to programatically get the APN settings that are already in the phone, that have been set by the owner/carrier?

 

Compiling a list of 100+ APNs, from around the world, and doing trial-by-error at run-time seems like a bad idea?

Thanks...

 

Please use plain text.
Developer
peter_strange
Posts: 19,604
Registered: ‎07-14-2008
My Device: Not Specified

Re: Connecting your BlackBerry - http and socket connections to the world

"Is there a way via java/code/api to programatically get the APN settings that are already in the phone".

 

I am not aware of any way of doing this.

Please use plain text.
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.634 Dev OS, Z30 (STA100-5)-10.3.1.634 Dev OS, Passport (SQW100-1)-10.3.0.1154, PlayBook (16GB)-2.1.0.1917

Re: Connecting your BlackBerry - http and socket connections to the world

Though it is not very detailed and might not be any help at all I found this: http://www.blackberryfaq.com/index.php/Carrier_specific_APN/TCP_settings

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Please use plain text.
Developer
Developer
bo
Posts: 167
Registered: ‎11-12-2008
My Device: Not Specified

Re: Connecting your BlackBerry - http and socket connections to the world

I have a question about WiFi.

 

I was testing using an T-Mobile Curve 8320 and I appended ";ConnectionUID=WAP2 trans" to the URL and the device definitely went over my WiFi connection.  Is this just the case for T-Mobile/UMA devices?

 

The reason I ask is that all the code samples I see try to detect WiFi and then explicity append ";interface=wifi", but from my tests it doesn't seem like that's necessary.

Please use plain text.
Developer
sudhakar_koundinya
Posts: 66
Registered: ‎01-14-2010
My Device: 8700

Re: Connecting your BlackBerry - http and socket connections to the world

Hello Peter

 

Thankyou for nice stuff. But I am not seeing much details on HTTP/TCp connection information over SSL.

 

SSL and HTTPS always annying me and misleads me in different aspects.

 

If possible can you post these details also in this thread?

 

 

Thanks

Sudhakar Chavali

Please use plain text.
Developer
schepurny
Posts: 168
Registered: ‎11-22-2009
My Device: 9000 Bold, 8300 Curve

Re: Connecting your BlackBerry - http and socket connections to the world

Here's a connections question that I would like to add to the mix, although I think I know the answer already.

 

If I take a Midlet that runs on a regular phone supporting J2ME should I expect that anything using an HttpConnection or SocketConnection won't run "out of the box" on a Blackberry? I'm assuming it would have to be ported.

 

 

Please use plain text.
Developer
peter_strange
Posts: 19,604
Registered: ‎07-14-2008
My Device: Not Specified

Re: Connecting your BlackBerry - http and socket connections to the world

AFAIK, the code will run out of the box, however it will not have the connection suffix, so will only use the default transport method, whatever that happens to be.  So some heuristics to decide what to specify might need to be added, but that should be about it.

 

One other thing, I presume the network connection is done on a background Thread.

Please use plain text.
New Developer
jamapper
Posts: 14
Registered: ‎01-25-2010
My Device: 8310

Tried and tried but I still can't get it to work - Please Help

Thanks a lot for all the useful information provided in this thread. I'm new to Blackberry dev so bear with me.

 

I'm building that app that needs to get some XML from a web server. I've successfully gotten it to work on the simulator but have been unable to get it working on my 8310. I've read about the different transports and used the following code to try to select the appropriate option.

 

Simple function to get WAP service record.

 

 

private ServiceRecord getWAP2ServiceRecord() {
        ServiceBook sb = ServiceBook.getSB();
        ServiceRecord[] records = sb.getRecords();
        for (int i = 0; i < records.length; i++) {
            String cid = records[i].getCid().toLowerCase();
            String uid = records[i].getUid().toLowerCase();
            if (cid.indexOf("wap") != -1 && uid.indexOf("wifi") == -1
                    && uid.indexOf("mms") == -1) {
                return records[i];
            }
        }
        return null;
    }

 

Conditions used to build string.

 

 

String connectionParameters = "";
			// JDE 4.3 is required to get WLANInfo
            if (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED) {
                // Connected to a WiFi access point
                connectionParameters = ";interface=wifi";
            } else {
                int coverageStatus = CoverageInfo.getCoverageStatus();
                ServiceRecord record = getWAP2ServiceRecord();
                if (record != null
                        // In JDE 4.5 CoverageInfo changed the name of COVERAGE_CARRIER to COVERAGE_DIRECT
                        // The constant value for both is the same, '1', so you can use that to avoid any
                        // dependency on JDE 4.5
                        && (coverageStatus & CoverageInfo.COVERAGE_DIRECT) == 
                        CoverageInfo.COVERAGE_DIRECT) {
                    // Have network coverage and a WAP 2.0 service book record
                    connectionParameters = ";deviceside=true;ConnectionUID="
                            + record.getUid();
                } else if ((coverageStatus & CoverageInfo.COVERAGE_MDS) == 
                        CoverageInfo.COVERAGE_MDS) {
                    // Have an MDS service book and network coverage
                    connectionParameters = ";deviceside=false";
                } else if ((coverageStatus & CoverageInfo.COVERAGE_DIRECT) == 
                        CoverageInfo.COVERAGE_DIRECT) {
                    // Have network coverage but no WAP 2.0 service book record
                    connectionParameters = ";deviceside=true";
                }
            }

 

I've even tried to hard code the WAP service record I see in my phone.

 

";deviceside=true;ConnectionUID=WAPtrans Secure"

 

I'm out of ideas here so any assistance would be really appreciated.

 

As I said, everything works fine on the simulator but when I load it on my phone there's no effect.

Please use plain text.
Developer
peter_strange
Posts: 19,604
Registered: ‎07-14-2008
My Device: Not Specified

Re: Tried and tried but I still can't get it to work - Please Help

Please don't add questions to this Thread, it is intended as an information Thread only.  Please start a new Thread with the information you have provided here.

 

When you do, please also tell us exactly what happens when you run your code on the Device.  What exceptions are thrown, what return code do you get on your http request, which connection method has your logic actually tried to use.  It might also be useful to know what device and OS you are using and what carrier you are on. 

Please use plain text.