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
Posts: 91
Registered: ‎02-04-2009
My Device: Not Specified

Accessing RIM's Resource Bundles

Is it possible to access the built-in resource bundles on a device?  In my application, I need to create a screen with my own "Save" and "Cancel" buttons.  My application supports nine languages, but I would like to avoid having to translate strings like Save, Cancel, Yes, No, etc. that are already exist on the device.  Is it possible to reference RIM's bundles?

 

I know that some strings live in the bundle "net.rim.device.internal.resource.Common."  I even know that the strings for "Save" and "Cancel" are at ids 18 and 19 on my Storm.  But, I doubt this is officially supported.

Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: Accessing RIM's Resource Bundles

I don't completely know if I'm right! As far as I know, this Class had not been exposed.. But when you use it in your application, you would not able to sign your application, since there would be one extra key signer needed other than the three that are given for $20, which RIM hasn't kept for sale :smileyhappy: ..

 

Cheers.. 

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
Posts: 91
Registered: ‎02-04-2009
My Device: Not Specified

Re: Accessing RIM's Resource Bundles

The following code runs successfully on a Verizon Storm 9530.  It creates a screen with "Save" and "Cancel" buttons.  The text is pulled from RIM's internal resource files.  I'd love to replace the 18 and 19 with constants, but I don't think they are exposed.

 

MainScreen screen = new MainScreen();

ResourceBundleFamily resources = ResourceBundle.getBundle("net.rim.device.internal.resource.Common");

screen.add(new ButtonField(resources.getString(18)));

screen.add(new ButtonField(resources.getString(19)));

UiApplication.getUiApplication().pushScreen(screen);