1
votes

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.

2
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
I removed the connection information still it doesn't want to connect. I get null from the ConnectionFactory's method getconnection() - BurunduK

2 Answers

0
votes

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.