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
Contributor
Posts: 13
Registered: ‎05-21-2010
My Device: Blackberry Pearl 8100
My Carrier: Claro

Can't add resources to my application

Hey guys,

 

I'm finding this task quite difficult to do...

 

What I usually do when I want to add resources to any mobile project is simply drag and drop the resources I want to my project and they end up being there.

 

It seems I'm missing a step and I can't find any tutorial or any place where it explains how to add resources (images, sounds, videos, etc.) to a project.

 

I successfully added a folder with 2 pngs on my project but they don't get added on the final COD package.

 

What is the process to add resources to a Blackberry project using Eclipse 3.4?

 

Best regards

Contributor
Posts: 13
Registered: ‎05-21-2010
My Device: Blackberry Pearl 8100
My Carrier: Claro

Re: Can't add resources to my application

So just you know, I've tried:

 

Dragging and dropping the resource folder containing my pngs. I've tried Importing it as a File System, I also tried creating a new Folder in the project and linking it to my resource folder.

 

It always appears on the project, but it never gets added to the COD file. I read that you could put them on the "src" folder, but there has to be a proper way of adding resource to the project.

 

Thanks a lot!

 

Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Can't add resources to my application

They need to be in the src or res folders. That is the only way it will add them to the COD.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Contributor
Posts: 13
Registered: ‎05-21-2010
My Device: Blackberry Pearl 8100
My Carrier: Claro

Re: Can't add resources to my application

Hey!

 

Thanks a lot for your reply!

 

I forgot to mention, I -am- and always used "res" as the name of the folder where I put my resources. Is there any special way of adding this directory to the project?

 

Thanks!

Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Can't add resources to my application

If you used the res folder then is should be included in the project.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Developer
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: Can't add resources to my application

You may need to refresh your project after adding the files. Highlight the project name in the Package Explorer and press F5 or select Refresh from the context menu.




Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.
Contributor
Posts: 13
Registered: ‎05-21-2010
My Device: Blackberry Pearl 8100
My Carrier: Claro

Re: Can't add resources to my application

Of course! The files are added on the res folder, they are in the physical directory and they show up in the Eclipse Package Explorer, but they don't get inserted on the COD file...

 

This doesn't look like a normal issue.

 

By the way, when you mention "The res folder", it sounds like there is one there by default. I don't have one "by default" when I create my Blackberry project, I add it manually in my project's root path, at the same level the src and bin folders are. Is that correct?

 

Perhaps this is an issue with the 1.0 Plug-in only...? I also read the Beta had some issues with importing resources.

 

Thanks for all your replies, guys!

 

Developer
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: Can't add resources to my application

That's what I do. You may also need to add the res folder to the project's build path. Right click on the project and select properties. Select Java Buid Path on the left and the Source tab on the right. If the res folder (or a parent of it) isn't listed, click the Add Folder button to add it.




Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.
Highlighted
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Can't add resources to my application

You have to do what Ted said. I am uing 1.1 and the res folder is created when you create the project but only what's in the build path gets added to the resulting COD.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.