02-24-2009 02:08 AM
I have gone through the developer guide for localizing applications. But its quite confused. I followed following steps
In BlackBerry JDE
1. I tried to create .rrc and .rrh file by Right Clicking on Project -> Create New File. But when i try to open that. I get error "Was expecting ; or .". I guess we cant create like that.
2. As the above option didnt work. I tried to create New Project -> Selected type Language Resource -> Entered File name. We get .rrc and .rrh file (I can add key value here) with <project_name>Resources.java file (In which they explain how to use the bundle). But a interface in which BUNDLE_ID and BUNDLE_NAME etc are defined is not visible not sure why? (As mentioned by Johnathan Fisher in Localization Article) . I tried to create a screen in this project and use the resources. I am able to compile that. But that is not visible in downloads. Not sure if this is because of Project Type - Language resource.
3.Then I tried to decompile the Interface class file generated above and use in a HelloWorld project. Where i manually added the interface code to HelloWorld File. And then it worked. But if we have to manually add the interface code, then its not a good practice and automatically its not working in step 2.
In Eclipse with JDE Plugin.
1. I create New -> Other -> Resource File -> .rrc and .rrh file is created. I manually add the file for interface. It compiles successfully. But gives JVM 104 error (Resource Exception) while running in emulator. Not sure what is the problem.
So the steps are not clear.
Anyone can please provide me clear steps how it should work.
Thanks in advance,
Solved! Go to Solution.
02-24-2009 02:51 AM
02-24-2009 04:11 AM
Thanks. I tried it and it worked in Eclipse and BlackBerry JDE .
In Eclipse, I created New -> Other -> BlackBerry Resource File -> Selected Location under src/com/company i.e. where my source file of hello world project is located (File name same as project name as you mentioned). After doing this, if we check the JAR, it is automatically generating HelloWorldResource interface. And it works smoothly. So the only problem was i was not creating the resource file with application name. And here we dont have to create a seperate project for resourcebundle.
But in JDE, i have some doubt. We have to create a language resource project seperatly. I created a project LocalizationDemo (named resource file to HelloWorld) and in that it creates the HelloWorldResource interface. But i wanted to add the localization to HelloWorld project. I copied the .rrc, .rrh files to resource folder under HelloWorld poject and added them to project. And i had to add following import statement.
I checked the localizationdemo supplied in samples workspace in JDE. There they dont have any import statement and the Interface is in same project. So in this sample JDE localzation demo and Eclipse things work without import statements, but in newly created project I had to follow the above stated procedure. Not sure if this is fine. Ideally I thought I should be able to create resource file inside HelloWorld project instead of creating a seperate resource project.
Please provide your opinion on this.
Thanks and regards,
02-26-2009 03:54 PM
10-05-2011 02:21 AM
I have to implement the localization in my application,
so please give me some guidence that from where I should start,If possible please send me some source code and some important links.
Thanks in Advance..
10-05-2011 03:48 AM