Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
ldbbdevelopervn
Posts: 80
Registered: ‎03-19-2009
My Device: Not Specified

Help me ! Resource file path problem in JDE 4.5.

In JDE 4.7 or Eclipse with JDE 4.5 plugin, my app load image resource with path of image file (Ex : src\img\test.png). But In JDE 4.5, It fail. If I move test.png file to the same folder with java code file, It load image OK. It seem JDE 4.5 can not find image resource with path src\img\test.png. Is this a problem of JDE 4.5. Help me ! Thanks very much !:smileyindifferent:

PPCLINK Blackberry Team
The Best Software for Smartphone World.
Website : www.ppclink.com
Please use plain text.
Developer
ldbbdevelopervn
Posts: 80
Registered: ‎03-19-2009
My Device: Not Specified

Re: Help me ! Resource file path problem in JDE 4.5.

Help me. Thanks !

PPCLINK Blackberry Team
The Best Software for Smartphone World.
Website : www.ppclink.com
Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Help me ! Resource file path problem in JDE 4.5.

Check this post:

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&view=by_date_ascending&messa...

 

There is zip file attached to that post.

 

Download it, unzip and run in JDE 4.5

 

It works ok and shows the picture.

Please use plain text.
Developer
ldbbdevelopervn
Posts: 80
Registered: ‎03-19-2009
My Device: Not Specified

Re: Help me ! Resource file path problem in JDE 4.5.

Thanks for your reply. I see the attached project,  it mean in JDE 4.5, not need fullpath of image resource (need only image file name : Bitmap.getBitmapResource(filename)). But, If my resource has 2 image with the same file name and store in 2 folder. How to get image resource I want ? Waiting for your reply. Thanks ! :smileyindifferent:

PPCLINK Blackberry Team
The Best Software for Smartphone World.
Website : www.ppclink.com
Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Help me ! Resource file path problem in JDE 4.5.

Documentation says that getBitmapResource gets resource name, not path.

 

And if there are several resources with the same name only one will be processed.

 

I tried to use this.getClass().getResourceAsStream()

 

But it also gets resource name, not path.

 

The result of my investigation is:

 

there is no way to have two resources with the same names into one cod file and process them separately.

 

Give unique names to your resources to let the application recognize them.

 

As getBitmapResource() can access another cod file for a bitmap you can store images with the same names in different cod files.

Please use plain text.
Developer
ldbbdevelopervn
Posts: 80
Registered: ‎03-19-2009
My Device: Not Specified

Re: Help me ! Resource file path problem in JDE 4.5.

Thanks tbilisoft. I seem be a limit of JDE 4.5 because In JDE 4.7 or Eclipse with JDE 4.5 plugin, I try getBitmapResource() with image file path (Ex : src/res/img/folder1/img1.png) and It work OK ! :smileyindifferent:

PPCLINK Blackberry Team
The Best Software for Smartphone World.
Website : www.ppclink.com
Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Help me ! Resource file path problem in JDE 4.5.

There is Developer Issue Tracker:

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&thread.id=45295

 

Submit your issue about JDE 4.5

Please use plain text.
Developer
ldbbdevelopervn
Posts: 80
Registered: ‎03-19-2009
My Device: Not Specified

Re: Help me ! Resource file path problem in JDE 4.5.

Ok. Thanks tbilisoft for your helping. I will submit my issue. Nice weekend ! :smileyindifferent:

PPCLINK Blackberry Team
The Best Software for Smartphone World.
Website : www.ppclink.com
Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Help me ! Resource file path problem in JDE 4.5.

Thank you :smileyhappy:

 

Nice weekend to you too :smileyhappy:

Please use plain text.
New Developer
ohadmayrom
Posts: 2
Registered: ‎09-29-2009
My Device: Not Specified

Re: Help me ! Resource file path problem in JDE 4.5.

Hi,

 

I'm using NetBeans IDE 6.5.1 with BlackBerry JDE 4.7.0 (The Blackberry simulator is invokes from NetBeans).

Like others the application has access only to files on src directory (on jar file) when loading files form directories below there is a message:

FRIDG: could not find images/MMS.png (the path on jar file is /src/images/MMS.png)

 

Any assistent will be great.

Thanks,

 

Ohad.

 

 

 

Please use plain text.