Can't open the application

HII I am unable to open the application please help me it's my code

class WebImageScreen extends MainScreen {
        BitmapField bitmapField ;

     public WebImageScreen() {

         setTitle("WebimageField");
          bitmapField=new BitmapField(connectServerForImage("http://www.betribes.com/a/flyers/qq/81/ig/78/fits_within_120x120.jpg"));

            add(bitmapField);

     }

public static Bitmap connectServerForImage(String url) {

          HttpConnection httpConnection = null;
          DataOutputStream httpDataOutput = null;
          InputStream httpInput = null;
          int rc;

          Bitmap bitmp = null;
          try {
           httpConnection = (HttpConnection) Connector.open(url);
           rc = httpConnection.getResponseCode();
           if (rc != HttpConnection.HTTP_OK) {
            throw new IOException("HTTP response code: " + rc);
           }
           httpInput = httpConnection.openInputStream();
           InputStream inp = httpInput;
           byte[] b = IOUtilities.streamToBytes(inp);
           EncodedImage encodedImage = EncodedImage.createEncodedImage(b, 0, b.length);
           bitmp = encodedImage.getBitmap();

          } catch (Exception ex) {
           System.out.println("URL Bitmap Error........" + ex.getMessage());
          } finally {
           try {
            if (httpInput != null)
             httpInput.close();
            if (httpDataOutput != null)
             httpDataOutput.close();
            if (httpConnection != null)
             httpConnection.close();
           } catch (Exception e) {
            e.printStackTrace();

           }
          }
          return bitmp;
         }
    }

Please help me...

If you test this on the Simulator, you probably need to add; deviceside = true to the URL. I suggest you take a look at Pierre sticky thread on http connections.

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for

  • iPad update to ios 10 problems

    IPad 2 completely crashed during update to iOS 10, cannot access all the ipad. Connected to iTunes, I tried Ipad2 update, did not work. Once again I tried to restore, did not work. need a solution to the problem.

  • Duplex charger HP 8620 document Mac error - 'the scanner could not complete the scan.

    Hello When the analysis attempted double helped since the document feeder, I get the following error: the scanner was unable to complete the scan If I don't select duplex option, the printer scans very well. I really need the duplex feature was that

  • servo

    Hello. I need to educate yourself on the hydraulic servo control with Labview. I have the card DAQ 6024. Can I control the servo-valve with 6024 map and Labview 6.1 and also for the position of the hydraulic cylinder, I will use a lineer potantiomate

  • Error code: 0X800704C8 (cannot install updates)

    XP: I get a 0x800704C8 error message when you try to access the windows updates (it seems to me that this error message is not recognized by Windows)

  • __daily down loads

    I have a laptop that runs Windows 7 Home premium. Windows tries to down load 7 updates 1 whenever I turn off the machince. This has happened for at least two weeks. What is the problem that downloads do not take and how to fix this problem?