imagenetwork-programmingblackberryjava-merim-4.6

Blackberry App, display images from Web


I'm using the Blackberry JDE (9000 simulator), and am wondering if I can display an image from the web.

Currently, I'm seeing tutorials that use Bitmap.getBitmapResource to display images that are local to the blackberry application, but looking at the API, I'm not seeing any support for giving a web URL.

Are there other Blackberry image classes I can check out? Or is this feature just not supported?


Solution

  • You can download image using HTTPConnection and InputStream, create EncodedImage from stream and then display it.

    See coderholic - Blackberry WebBitmapField

    BTW, you can use IOUtilities.streamToBytes() method to read bytes from InputStream directly!