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
New Contributor
ptuckey
Posts: 7
Registered: ‎07-21-2011
My Device: 9800
My Carrier: Telus
Accepted Solution

Handling Resource Files .rrh/.rrc on command line builds

I am adding internationalization to a current Blackberry product, so I have converted all the Strings to be loaded from Resource Files.  This works well when I build from Eclipse, but doesn't work with our current command line builds for distribution.

 

Eclipse compiles .rrh/.rrc files into the following files, hidden in "./locale_interfaces":

./locale_interfaces/*£.crb (one of these for each .rrc file)

./locale_interfaces/com/.../*Resource.java

 

The problem I'm running into with command-line builds, is that I get a "Missing Resources" exception at run-time, even though I'm including the .rrh/.rrc files in the build.

 

So my question is: what files do I need to include in the build?  Is it the .rrh/.rrc files, or is it the ./locale_interfaces/*£.crb files?  I have not been able to find much info on .crb files.

 

Thanks

 

Please use plain text.
New Contributor
ptuckey
Posts: 7
Registered: ‎07-21-2011
My Device: 9800
My Carrier: Telus

Re: Handling Resource Files .rrh/.rrc on command line builds

This took me a long time, but I finally figured it out, so thought I'd share the solution that I'm using.

 

The *.crb files are indeed the compiled versions of the .rrh/.rrc files, and yes they need to be included in the jar/cod.  The .java interface file also needs to be included, of course.

 

I was running into a problem though, because of the '£' character which gets included in each *.crb file.  My command line setup is a python script that executes subprocess commands.  Although the '£' charater was handled properly in the python as unicode, it seemed to cough up on the native subprocess execution, which caused the build to break if I tried to include it.

 

So, to get around this, I changed my subprocess JAR command to look for .locale_interfaces/*.crb, thus avoiding the use of the '£' character.

Please use plain text.