Blackberry BitmapField from SD card

I want to show a image from the SD card in a BitmapField. How to do that? Can anyone give me some sample code for that?


This may be Help full.

public Bitmap getImage(){
    Bitmap bitmapImage=null;
        InputStream input;
        FileConnection fconn = (FileConnection)"file:///store/home/user/dirname/imgname.png", Connector.READ_WRITE);
        input = fconn.openInputStream();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        int j = 0;
        while(( != -1) {
        byte[] byteArray = baos.toByteArray();

        bitmapImage = Bitmap.createBitmapFromBytes(byteArray,0,byteArray.length,1);

    }catch(Exception ioe){
    return bitmapImage;


Need Your Help

Update class X created by class A from class B. Encapsulation issue

c# design-patterns encapsulation

Previous question (easier): Update class from another class, encapsulation issue

Does the Java VM move objects in memory, and if so - how?

java memory-management garbage-collection jvm

Does the Java virtual machine ever move objects in memory, and if so, how does it handle updating references to the moved object?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.