Activate search resource group using the string key

Hi all

RIM has provided APIs (Resource Bundle) to support the localization of the applications. We are able to use it

ResourceBundle.getBundle(BUNDLE_ID, BUNDLE_NAME).getString(key);

He expects int key and generated dynamically by Blackberry. There are 2 cases.

  1. Local labels, we are aware and we can provide keys for those who, for the latter is no problem.
  2. From backend error codes. This is not a definitive list. This is the string value. But we cannot find the resource group by using this key of type string. We have to check what the error code and create the key to this and allows to retrieve the label.
if(errorCode.equals("SOME_ERROR_CODE"){
   Dialog.alert(LanguageResource.getString(SOME_ERROR_CODE));
} else if (errorCode.equals("ANOTHER_ERROR_CODE"){
   Dialog.alert(LanguageResource.getString(ANOTHER_ERROR_CODE));}

To avoid this check, we thought that if this was possible.

String msg =  LanguageResource.getString("SOME_ERROR_CODE"));
if (msg == null) // Label not found
   Dialog.alert(LanguageResource.getString("GENERAL_ERROR");
else
  Dialog.alert(msg);

Now, API provides no support for this, is the solution to create the own property file and load them but I think that the Blackberry does support playback of the file as Java Standard properties or may be something else. The same reflection API is not supported in Blackberry up to now, there may be support in the future. This could allow to dynamically use the variable as the key name.

Someone did it faced simular situation and made a work around? All entries would help.

Kind regards

Sandeep

Edited: updated information on option of the reflection API.

It will never take in charge of reflection as the baseline for BB Os is J2ME and therefor java 1.3/1.4

you will have to translate the error to the resource key string yourself.

Tags: BlackBerry Developers

Similar Questions

  • Get a resource by using a string key

    Hello

    How to make an array of strings using a string key of resource...

    for example, I have 4 tables of string defined in resources.

    D1, d2, d3, d4

    How can I get these resources.

    private static nameResources ResourceBundle is ResourceBundle.getBundle (BUNDLE_ID, BUNDLE_NAME);.

    It seems you want to have the advantage to use localization, but also to make code that selects the key dynamic localization.

    You will need to present this dynamic change.  Here is an example (not your example exactly, but something I hope you can extend your needs).

    Suppose you have the choice between 3 messages, and you choose us the one determined by the variable messageIndex you set which can be 0, 1, or 2.  Messages are resources, and have the ID

    MESSAGE_ZERO

    MESSAGE_ONE

    MESSAGE_TWO

    In your program, you can do the following:

    private static nameResources ResourceBundle is ResourceBundle.getBundle (BUNDLE_ID, BUNDLE_NAME);.

    private messages of the static string = new {String]

    nameResources.getString (MESSAGE_ZERO),

    nameResources.getString (MESSAGE_ONE),

    nameResources.getString (MESSAGE_TWO)

    }

    ....

    String thisMessage = messages [messageIndex];

    Edit:

    If you wanted to extend this so that you can use a string as the 'index', then the easiest option would be to replace message board in the above example with a hash table and fill the table using hash

    -the channels that you want to search on as keys, and

    -the extracted values of all resources data.

    Hope it makes sense.

  • Re: Unable to activate Windows Vista Business using the Microsoft key

    I am facing difficulties to activate the microsoft package, whenever I enter the product key printed on the label attached to my pc, it says wrong key.
    Help, please.

    The key to Microsoft, that you can find on the lower side of your laptop is not a kind of universal key and this key belongs to Vista preinstalled on your laptop. You got your laptop with Vista preinstalled. With your laptop, you have paid a license and an operating system.

    After recall of Toshiba you must create Toshiba Recovery DVD or this facilities you can use if often you want with your laptop. This version of Vista belongs to you and can only be used with your laptop.

    If you are using Microsoft facilities DVD you must have the key for this version. If you do not, you must purchase a key online and activate a preinstalled Vista version.

  • Reinstalling Windows Vista tells me to activate windows, but don't let me use the same key

    I had to erase and reinstall and now it tells me to activate windows, but don't let me use the same key... I don't want to buy a new key, I always use the same program Windows Vista... HELP Please!

    Original title: the windows product key

    Hello

    How do you re-install?

    Do you have or use a sale at retail or OEM DVD?

    Do you have an error message: "key already in use"?

    If you re-installed the same operating system on the same computer and you receive an error message, you will normally need to make a phone Activation > ignore the automatic prompt > and brace yourself for a real person explain.

    "How to activate Vista normally and by Activation of the phone '

    http://www.Vistax64.com/tutorials/84488-activate-Vista-phone.html

  • Can I use the Vista key code to activate this Windows 7?

    Original title: Windows 7 and key code

    I have a Dell laptop that I replaced the drive on. Originally Vista and Windows 7. I reloaded Vista but if I load this https://www.microsoft.com/en-us/software-download/windows7

    Can I use the Vista key code to activate this Windows 7?

    No, you need the product key for Windows 7, Windows 7 uses its own unique product key. What you can do is to reload the old hard drive, and then try to recover the product key:

    Here are four utilities, which can display your product keys if they are still there:
    Belarc Advisor: http://www.belarc.com/free_download.html
    (He did a good job of providing a wealth of information.)
    Also: http://www.magicaljellybean.com/keyfinder.shtml
    and: http://www.nirsoft.net/utils/product_cd_key_viewer.html
    and RockXP: http://www.majorgeeks.com/download4138.html which has additional features
  • If I uninstall Windows 7 and then reinstall it on the same computer, using the same key/copy register?

    Need a quick answer here! I'm selling my older HP laptop that has Windows 7 above. I intend to uninstall the operating system, and then reinstall it to wipe all my data. The copy is just a simple upgrade from Home Premium (the laptop came with Vista). When I reinstall, can I still register by using the same key? I have heard that it is installed on a computer at any time then you can, but I'm not completely sure.

    Enable is the right term, Yes. Now what happens if I simply select "Custom" when I try to install the upgrade of Windows 7 since I don't have a Vista disk?

    If your Windows 7 is an upgrade license any system move to must have a previous operating system eligible before you can use it elsewhere. You may also need to reactivate by phone:

    How to activate Windows 7 manually (activate by phone)
     
    1) click Start and in the search for box type: slui.exe 4
     
    (2) press the ENTER"" key.
     
    (3) select your "country" in the list.
     
    (4) choose the option "activate phone".
     
    (5) stay on the phone (do not select/press all options) and wait for a person to help you with the activation.
     
    (6) explain your problem clearly to the support person.
     
    http://support.Microsoft.com/kb/950929/en-us

  • How get the resource group in the application model by local current-based program?

    Hi all


    We use JDeveloper Studio Edition Version 12.1.3.0.0 and deployed on GlassFish Server Open Source Edition 3.1.2.2 (build 5) and connect to the SQLServer database.


    How get the resource group in the application model by local current-based program?

    We have two local unions; En and Ar.

    -Resource Bundle for Arabic: ModelBundle_ar.properties

    -Bundle resources for English: ModelBundle_en.properties

    We try to use the code but the room below is still in English

    ResourceBundleDef resourceDef = this.getResourceBundleDef ();

    Settings regional locale = this.getDBTransaction () .getSession () .getLocale (); How to change the locale in the session?

    Dim retVal =

    StringManager.getLocalizedStringFromResourceDef (resourceDef, key,

    local, NULL, null,

    (false);

    Also, this is the code that I use when changing the local at the bean:

    Locale newLocale = new local (local);

    FacesContext context = FacesContext.getCurrentInstance ();

    context.getViewRoot () .setLocale (newLocale);

    refreshPage();



    Settings regional locale = this.getDBTransaction () .getSession () .getLocale (); How to change the locale in the session?

    This will return a locale for db connection.

    Instead, try with: ADFContext.getCurrent () .getLocale)

    Dario

  • Why all my keyboard shortcuts use the 'Alt' key instead of the ' CTRL '? I use Windows 7 and Firefox 5.0.1.

    I recently downloaded Firefox 5 and noticed that all my keyboard shortcuts by default using the 'Alt' key instead of the 'Ctrl' key (so, for example, open a new tab is Alt + T instead of Ctrl + T).

    I noticed that this applies even to copy and paste in Firefox (Alt + C and Alt + P is the only commands that work).

    No idea why this is happening? I am running Windows 7 and Firefox 5.0.1.

    I had this problem. I found that a roaming profile directory has been installed which contained a user.js file in which changed the hotkey of CTRL ALT.
    I deleted the profile folder a name randomly in c:/Users / [myuser] / AppData/Roaming/Mozilla/Firefox/Profiles and then I stuck to that of c:/Users / [myuser] / AppData/Local/Mozilla/Firefox/Profiles.

    This bad user.js file was some other parameters, including the definition of the user agent string
    "Mozilla/5.0 (X 11;" U; Linux i686; en-US; RV:1.0.0; (Salut, maman) gecko/20020604 "

    The user.js file is (or similar to) those listed here: https://www-archive.mozilla.org/unix/customizing.html

  • Why can I not use the tab key to highlight the links on a Web page?

    In previous versions of FF and in other browsers, I use the tab key to navigate through all the links on a Web page - I can't do this with FF5, the tab key will highlight only the address bar, search bar, and any form of fields on a Web page.

    Using the button tab to navigate through the links on a page is an accessibility feature, and I use it often to display links to jump hidden at the top of a Web page for users who prefer the keyboard on a mouse and assistive technologies.

    Is this something that can be turned on in the preferences? Or is there a reason why it has been removed from this version?

    It can be fixed in Mac OS X Tiger preferences (keyboard-> "all controls") or try a ctr - F7

  • Tried to re - install XP with Microsoft Certified intallation disk using the original key code, but the installer doesn't recogize my valid original key code.

    Tried to reinstall XP with Microsoft Certified intallation disk using the original key code.  But the installer refuses to recogize my valid original key code.  How can I "force" the program to accept the code and/or how to circumvent the code and reinstall XP?

    original title: tried to reinstall XP

    How to activate Windows XP
    http://support.Microsoft.com/kb/307890/en-us

    See the section titled: "how to activate Windows XP by phone.
    Also, make sure that you do not confuse the product key numbers and letters
    (number 8 for the letter B, etc.)

    Blank page to activate Windows in the wizard of Windows Product Activation
    http://support.Microsoft.com/kb/314935

    How to contact a Microsoft Product Activation Center:
    http://support.Microsoft.com/default.aspx/KB/950929/en=us

    Microsoft Activation centers worldwide telephone numbers:
    http://www.Microsoft.com/licensing/existing-customers/activation-centers.aspx
    (This site is for activating Volume License, but if you call, they will help you)

    The phone number is not working:
    Microsoft Wordwide contacts: http://www.microsoft.com/worldwide/default.aspx

    Once Windows activated / Genuine Advantage Notifications:
    http://www.Microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=afd45b36-3d77-4259-801c-d31a9a90cdcf
    (This tool will confirm that the copy of Windows installed on your PC is genuine and authorized)

    J W Stuart: Http://www.pagestart.com

  • How do I stop using the product key in my PC, so I can use it in my laptop?

    A long time ago I had installed Windows Vista (original) on my PC at home. But now I m leaving in another city and I m just using my laptop. I received a message through the Windows Activation (¨The product key you typed is already use¨) and two options: buy a new online or type a different product key. I Don t want to buy anything and I Don t have a different product key. So, how can I stop using the product key in my PC (which i Don t use it!), so I can type in my laptop? Maybe uninstall Windows in my PC could solve the problem, but I Don t want to travel back home 7 hours for this! What can I do now?

    PS. : Sorry about my English, I m still learning!

    A long time ago I had installed Windows Vista (original) on my PC at home. But now I m leaving in another city and I m just using my laptop. I received a message through the Windows Activation (¨The product key you typed is already use¨) and two options: buy a new online or type a different product key. I Don t want to buy anything and I Don t have a different product key. So, how can I stop using the product key in my PC (which i Don t use it!), so I can type in my laptop? Maybe uninstall Windows in my PC could solve the problem, but I Don t want to travel back home 7 hours for this! What can I do now?

    PS. : Sorry about my English, I m still learning!

    Your English is very good.

    You simply need to activate Windows in the laptop by phone call at a command prompt, type slui 4.

    You * must * also to remove Windows from your desktop computer, but if it is to wait a few moments, it shouldn't be a problem.

  • Can't turn on my webcam using the F6 key.

    I have a MSI C series A6 200 - 221US

    Hello Sarge,

    Thanks for posting your question in the Microsoft Community. We are happy to help you.

    To help you to propose measures to solve the problem, I would appreciate if you could answer the following questions:

    • Have you ever activate your webcam using the F6 key?

    • If so, major changes have been made to your computer before this problem?

    I suggest you try the following steps.

    • Try to manually check if you are able to access your webcam.

    • Try to access your webcam from the webcam software that is installed on your computer.

    If you are able to access the webcam manually, then there is a possibility that the issue might be with the F6 function key.

    In case the problem is with the F6 key, I suggest you contact the computer manufacturer for assistance.

    Alternatively, you can try to install the driver of firmware on the MSI site for your webcam:

    For this refer to:

    http://www.msi.com/support/NB/CR620.html#down-firmware

    Hope this information is useful. Please let us know if you need more assistance.

    Thank you.

  • Can't use the product key, because 2 of the numbers/letters have rubbed off and I can't read them. What should I do?

    My computer crashed and now I have to put in my product key for microsoft. The only problem is that 2 of the numbers/letters have rubbed off and I can't read them. What should I do?

    Original title: product key

    Option 1:

    If the COA sticker is damaged, you must use the recovery partition to reinstall Windows 7, it will be exempt from the need to use the product key to activate your installation of Windows 7.

    Option 2:

    If your recovery partition is not available or damaged, you must contact the manufacturer of your computer, and request that a defined recovery disk you can use to reinstall Windows 7. They could practice a small shipping and handling. This will exempt the need to also use the product key.

    Option 3:

    If neither options 1 or 2 is possible, then you will need to invest in a new license of full version of detail.

    New computers coming often pre-installed with Windows 7 have what is called a recovery partition. This is used to reinstall an operating system in the case of a system failure. To access it, you need to start when you start your computer by pressing a function key. This can be either F1, F2, F9, F10, F11, F12 key DEL or tab. See the manual that came with your PC for instructions on how to reinstall Windows.

    This is how the recovery partition is accessible to most popular brands...

    For Dell, press CTRL + F11 directly after switching on the device

    For HP, press F11 directly after switching on the device

    For LG, press F11 directly after switching on the device

    For Toshiba, press and hold "0" BEFORE and during the power upward

    For Acer, press and hold ALT + F10, as soon as you see the logo

    For Asus, press F9, as soon as you see the Asus logo.

    For Samsung, press F4 to the power upward...

    For Fujitsu, press the F8 key directly after the power

    Advent, restart your computer. Then, press F10 repeatedly until the message "Starting system recovery"

    Sony VAIO, reboot and press "F8" or "F10" repeatedly until the screen "Advanced Boot Options".

  • Can I use the product key to my Home Premium pre installed windows 7 64-bit OS that are in my label of windows laptop back?

    I downloaded the iso file of windows 7 Home premium 64-bit. can I use the product key to my Home Premium pre installed windows 7 64-bit OS that are in my label of windows laptop back...

    Original title: the Windows 7 product key

    Yes you can. To learn more:

    http://techingiteasy.WordPress.com/2012/04/13/how-to-activate-Windows-7-OEM-license-using-a-retail-disc/

    If your computer is pre-installed with Windows 7 Home Premium, you should have a recovery if partition:

    New computers coming often pre-installed with Windows 7 have what is called a recovery partition. This is used to reinstall an operating system in the case of a system failure. To access it, you need to start when you start your computer by pressing a function key. This can be either F1, F2, F9, F10, F11, F12 key DEL or tab. See the manual that came with your PC for instructions on how to reinstall Windows.

    This is how the recovery partition is accessible to most popular brands...

    For Dell, press CTRL + F11 directly after switching on the device

    For HP, press F11 directly after switching on the device

    For LG, press F11 directly after switching on the device

    For Toshiba, press and hold "0" BEFORE and during the power upward

    For Acer, press and hold ALT + F10, as soon as you see the logo

    For Asus, press F9, as soon as you see the Asus logo.

    For Samsung, press F4 to the power upward...

    For Fujitsu, press the F8 key directly after the power

    Advent, restart your computer. Then, press F10 repeatedly until the message "Starting system recovery"

    Sony VAIO, reboot and press "F8" or "F10" repeatedly until the screen "Advanced Boot Options".

    ------------------------

    If the recovery partition is damaged or does not, you can then use the downloaded Home Premium as an alternative.

  • Can I change my Pro of Win7 32-bit to 64-bit by using the same key from the Dell OEM disc?

    I have a new laptop with Win7 32 on it, but I really wanted 64 bit - I missed that detail. I've read elsewhere that the 32-bit key is the same for 64.

    So, can I download Win7 64 Pro (same version, only 64-bit) and install it on the laptop using the Win7 32 bit key on the OEM disc?

    Thank you.

    Yes, it will work fine - the key for the same version of Windows works, whether at the level of the ILO.  You can download a retail ISO, burn to DVD, move in with him, then activate by phone (with Microsoft NOT Dell) using the product key on your COA sticker.

    www.mydigitallife.info/Download-Windows-7-ISO-Official-32-bit-and-64-bit-Direct-Download-Links

Maybe you are looking for