Adding a Resource File to the Application

Add a resource file to define the descriptive keys for each localized string.

  1. Open the BlackBerry application using the Java Perspective in Eclipse.
  2. Focus on the res folder, and right-click and select New > Package.
  3. In the New Java Package dialog, in the Name field, enter the same package name as the src package name, for example, "com.sybase.sup.samples.objectapi."
  4. Add the resource file under res > <package-name>.
    • Focus on res > <package-name> and right-click and select New > Other.
  5. In the New dialog, select BlackBerry > BlackBerry Resource File and click Next.
  6. In the New BlackBerry Resource File dialog, under the res package, enter the a file name for the rrh (resource header file) in the File name field. Name it by the project name.

    When you create a new resource header file, the BlackBerry® Java® Plug-in for Eclipse® creates the associated .rrc resource content file. For example, entering SUP101Sample.rrh creates SUP101Sample.rrh and SUP101Sample.rrc files.

    You can create additional resource content files as required for specific locales. These files must have the same name as the resource header file, followed by an underscore (_) and the language code, and then, optionally, by a single underscore (_) and a country code. Language and country codes are specified in ISO-639 and ISO-3166, respectively.