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
Regular Contributor
Posts: 68
Registered: ‎03-17-2010
My Device: 9000,9500,8900
My Carrier: Airtel,Vodafone

Re: Strange Behaviour of my application

Hi rex

 

Thanks for the suggession to check direct TCP connection

 

i'm trying with direct TCP connection but I think I'm also messing up here

 

I've tried two different post url and also got two different exceptions

 

1. when I tried

deviceside=true:apn=internet

 

The exception message is: Tunnel Failed

 

2. When I tried

deviceside=true;apn=blackberry.com

 

the exception message is related to some DNS kind of stuff

 

I don't know where exactly i'm doing mistake?

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Strange Behaviour of my application

What RexDoug was saying was with Verizon, you just need

";deviceside=true"

 

You don't need any APN information. 

Regular Contributor
Posts: 68
Registered: ‎03-17-2010
My Device: 9000,9500,8900
My Carrier: Airtel,Vodafone

Re: Strange Behaviour of my application

[ Edited ]

Hi Peter and rex.

 

Seems your suggession can work but there is another problem

 

at first I want you to check this code. I have updated my release to connect Directly over TCP.

 

 

public static void directTcp() {
        String post_url = "";
        post_url = ";deviceside=true";
        ConstantData.data += "\n\nPost URL Direct TCP: " + post_url;
        try {
            HttpConnection hc = (HttpConnection) Connector.open(
                    "the_url" + post_url,
                    Connector.READ_WRITE);
            ConstantData.data += "\n\n"
                    + "the_url"
                    + post_url;
            ConstantData.data += "\n\nGot Proper Responce?: "
                    + (hc.getResponseCode() == HttpConnection.HTTP_OK);
            if (hc.getResponseCode() == HttpConnection.HTTP_OK) {
                ConstantData.PostURL = post_url;
                ConstantData.data += "\n\nPost URL for TCP(After Connection): "
                        + post_url;
                return;
            }
        } catch (Exception e) {
            ConstantData.data += "\nError In Connection:" + e.getMessage();
        }
    }

 

I haven't loaded the release in Verizon yet but when this application is loaded in Vodaphone india it gets an error.

 

here is the value of ConstantData.data when loaded in bb8900 with Vodaphone India

 

Post Url Direct TCP: ;deviceside=true

Error in Connection: Tunnel Failed

 

And in Storm with Vodaphone India

 

Post Url Direct TCP: ;deviceside=true

Error in Connection: Tunnel Failed

 

I've gone through threads mentioning APN and APN in both device is www that is provided by vodaphone india

 

 

It can work with Verizon but same release is having problem with other providers.

What can be the reason?

and if possible solution?

 

 

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Strange Behaviour of my application

If you review this Thread:

http://supportforums.blackberry.com/t5/Java-Development/Connecting-your-BlackBerry-http-and-socket-c...

focusing especially on the Required Reading, you will see that there is not one single connection that works everywhere.

 

Your application will have to adapt its behaviour, by

1) detecting the environment and choosing the correct option,

2) trying various options and deciding on the best, or

3) asking the user to pick an option. 

 

The NetworkDiagnostic Tool provides reference code for (2). 

Regular Contributor
Posts: 68
Registered: ‎03-17-2010
My Device: 9000,9500,8900
My Carrier: Airtel,Vodafone

Re: Strange Behaviour of my application

Thanx Rex, your sugession worked.