1

Trying to connect via Wi-Fi and I have an issue with the OS6 cd variable is null but it works on OS5

This is the url Strng: https://api3.popfax.com/index.php?service=Popfax;interface=wifi;interface=wifi

public ServiceConnectionBlackBerry(String s) throws IOException {
        ConnectionFactory cf = new ConnectionFactory();
        ConnectionDescriptor cd = cf.getConnection(s);
        if (cd!=null){
            connection = (HttpConnection) cd.getConnection();
        }else {
        System.out.println("Strng: "+s);}
      }

can someone help please.

Iain Samuel McLean Elder
  • 19,791
  • 12
  • 64
  • 80
BurunduK
  • 293
  • 1
  • 3
  • 17
  • 3
    Why are you appending the URL with interface=wifi? I thought the point of ConnectionFactory was that it would choose which connection to use automatically? – Jonathan Sep 21 '11 at 17:31
  • I removed the connection information still it doesn't want to connect. I get null from the ConnectionFactory's method getconnection() – BurunduK Sep 22 '11 at 08:09

2 Answers2

0

When using ConnectionFactory you should not append any connection information to your URL. So instead you should just pass https://api3.popfax.com/index.php?service=Popfax to your method.

Scott W
  • 9,742
  • 2
  • 38
  • 53
  • I removed the connection information still it doesn't want to connect. I get null from the ConnectionFactory's method getconnection() – BurunduK Sep 22 '11 at 08:08
  • 2
    Well, the SDK docs indicate that `getConnection()` returns null if a connection cannot be established. It sounds like your problem may be outside of your code -- a problem with your data connections? – Scott W Sep 22 '11 at 12:32
  • Well using network diagnosis tool i get that wifi and all others fail on this device ... but very peculiar , the browser works perfectly ... – BurunduK Sep 22 '11 at 12:48
  • Perhaps you have a BIS connection available on your device? The browser could most certainly use this, but unless you have been granted access to BIS for your application, your app would not be able to use it. – Scott W Sep 22 '11 at 16:17
0

Open a Wi-Fi HTTPS connection may help you.

thanks

Stack User 5674
  • 1,548
  • 1
  • 20
  • 44