BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 11-15-2007, 05:06 PM   #1 (permalink)
New Member
 
Join Date: Nov 2007
Model: 1xp
PIN: N/A
Carrier: upyours cellular
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default adding files (images et al.) to a .jar

Please Login to Remove!

First of all, let me say how awful the BB JDE IDE is, and to make it worse, how poorly documented it is. SHAME ON RIM. I do like the simulator and debugging though.

Now then, how do I get arbitrary files added to the .jar (and then i presume, the .cod)? There are two types of files I wanted added.

1) a messages.properties file which contains translations. this comes from the netbeans localization support for MIDP applications. (stupid filename but whatever)
2) some .png images.

They are of course shown in the list of files in the workspace pane.

I've ticked them as "dependency only, do not build", just because hunting around it seemed like that might be what I needed. Apparently, that doesn't do it, or at least is not enough.

Also, i chose one of the png's as "use as application icon" but i still just get a generic icon. Note that this is the only image that makes it into the .jar. On a side note, right-click->"view" on my .png files doesn't do anything. At least an error message would be nice.

Last edited by mousecatcher : 11-15-2007 at 05:12 PM.
Offline  
Old 11-15-2007, 05:21 PM   #2 (permalink)
New Member
 
Join Date: Nov 2007
Model: 1xp
PIN: N/A
Carrier: upyours cellular
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

UNCHECKING "dependency only" gets my messages.properties saved into the .jar. I would have sworn that wasn't the case before. But anyway, now that it is in the .jar, when my app runs, I still get an exception about not being able to open that file. How can I inspect a .cod to see if it made it there?
Offline  
Old 11-15-2007, 05:57 PM   #3 (permalink)
Talking BlackBerry Encyclopedia
 
richard.puckett's Avatar
 
Join Date: Oct 2007
Location: Seattle, WA
Model: 9020
PIN: N/A
Carrier: T-Mobile
Posts: 212
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

How are you reading the file in? I did something similar just now and it worked fine...

o Right-click project
o Add File to Project...
o Select file
o Build, etc...

DataInputStream dis = new DataInputStream(getClass().getResourceAsStream("/messages.properties"));


As far as the COD format, the best resource I've seen so far is this:

reverse-engineering Reverse & Форсаж
Offline  
Old 11-15-2007, 06:41 PM   #4 (permalink)
New Member
 
Join Date: Nov 2007
Model: 1xp
PIN: N/A
Carrier: upyours cellular
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

that's exactly what i'm doing. i'll note that the message in the debug window (FRIDG: could not find blah blah) doesn't have the leading '/' on the filename.
Offline  
Old 11-15-2007, 07:19 PM   #5 (permalink)
New Member
 
Join Date: Nov 2007
Model: 1xp
PIN: N/A
Carrier: upyours cellular
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

UGH. If I comment all the getResourceAsStream() stuff out, I still get the FRIDG errors (and ultimate app failure). WTF.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.