title: Using ConnectionFactory and retrieve the data from url
body: <pre><code>public class ConsumeFactoryThread extends Thread {
      private String url;
  
      public ConsumeFactoryThread(String url){
  
          this.url = url;
  
      }
  
  
      public void run(){
  
          ConnectionFactory connFact = new ConnectionFactory();
          ConnectionDescriptor connDesc;
  
          connDesc = connFact.getConnection(url);
  
          if(connDesc != null)
          {
  
              HttpConnection httpConn;
              httpConn = (HttpConnection) connDesc.getConnection();
  
              try
              {
                  final int iResponseCode = httpConn.getResponseCode();
                  UiApplication.getUiApplication().invokeLater(new Runnable()
                  {
  
                      public void run()
                      {
                          //data retrieved
  
  
  
                      }
  
                  });
              }
              catch(IOException e)
              {
                  System.err.println("Caught IOException: " + e.getMessage());
              }
          }
  
      }
  
  }
  </code></pre>
  
  <p>I got the above code from one of Blackberry's articles, but I'm not entirely sure as to how I get the raw String of the contents of the url, which in my case is going to be a json string.</p>
  
  <p>I know when I was not using ConnectionFactory I used an inputstream to get the data, but I don't know if it is the same with the newer api.</p>
  
  <p>Thanks</p>