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
spiv
Posts: 21
Registered: ‎10-09-2008
My Device: Not Specified
Accepted Solution

Read JAD infos, ok but...

I succeed in reading a custom properties from the JAD file with application deployed OTA. See this post : http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&thread.id=6814

 

But :smileyhappy: Now I when enable the properties of my project to "System module"  and "Auto-run on startup", my app doesn't read read the JAD file anymore.

 

I use this code :

 

 

CodeModuleGroup[] allGroups = CodeModuleGroupManager.loadAll(); CodeModuleGroup myGroup = null; ApplicationDescriptor.currentApplicationDescriptor().getModuleName(); for (int i = 0; i < allGroups.length; i++) { if (allGroups[i].containsModule(moduleName)) { myGroup = allGroups[i]; //... reading custom properties break; } }

 

 That code works only when "System module" (I suspect this option)  and "Auto-run on startup" are disabled.

 

Any ideas ?

 

 

 

Sylvain.

 

 

Please use plain text.
Administrator
MSohm
Posts: 14,437
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Read JAD infos, ok but...

Does your application have multiple entry points?  If so it would have multiple ApplicationDescriptors that you can access using the CodeModuleManager class.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
spiv
Posts: 21
Registered: ‎10-09-2008
My Device: Not Specified

Re: Read JAD infos, ok but...

Hi, thanks for your response.

 

I checked and my application has no multiple entry points. Myapp just add custom menu items on the calendar app.

 

I made some others tests. The result is that I can't read the custom properties from the JAD file only when the option "Auto-run on startup" is enabled. If I disable this option, it's ok. The option "system module" has no effect on my issue.

 

I wonder why with this code blow, I can find my module/app in the array when the option "Auto-run on startup" is enabled and not when the option is enabled... ?

 

CodeModuleGroup[] allGroups = CodeModuleGroupManager.loadAll();

Is there anywhere else where I could find the information/custom properties of my app ?

 

Plz help :smileyhappy: !

 


 

Please use plain text.
Developer
spiv
Posts: 21
Registered: ‎10-09-2008
My Device: Not Specified

Re: Read JAD infos, ok but...

[ Edited ]

Another questions ?

 

My app has a module name and a handle (an integer). But when the option "Auto-run on startup" is enable, my module is not found in any CodeModuleGroup. Without a CodeModuleGroup, I can't access to the custom properties. 

 

Custom properties are only accessible from the CodeModuleGroup class or is threr an other way ?

 

I tried this :

 

 

CodeModuleGroup myGroup = CodeModuleGroupManager.load(ApplicationDescriptor.currentApplicationDescriptor().getModuleName());

 

 but it failed, myGroup is null.

Is there a way to load a CodeModuleGroup from a moduleName or a handleModule ? or anything else ?

 

Message Edited by spiv on 10-16-2008 02:23 PM
Please use plain text.
Administrator
MSohm
Posts: 14,437
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Read JAD infos, ok but...

What version of the BlackBerry JDE are you using to build your application?  What BlackBerry model and handheld software version are you testing with?  You can see this under Options, About on the BlackBerry.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
spiv
Posts: 21
Registered: ‎10-09-2008
My Device: Not Specified

Re: Read JAD infos, ok but...

[ Edited ]

I am using the Eclipse Plugin available on the BlackBerry site (v1.0.0.22).

 

I am using a simulator (installed with JDE 4.5.0) to emulate OTA installation :

BlackBerry 8310 v4.5.4.44(Platform)

Message Edited by spiv on 10-16-2008 04:12 PM
Please use plain text.
Administrator
MSohm
Posts: 14,437
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Read JAD infos, ok but...

What version of rapc are you using to build the application?  You can check this by going to the Window menu in Eclipse, selecting Preferences, expanding BlackBerry JDE and clicking on Installed Components.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
spiv
Posts: 21
Registered: ‎10-09-2008
My Device: Not Specified

Re: Read JAD infos, ok but...

I don't see any rapc reference... I have this :

 

Directory of Components :

 

BlackBerry JDE Component Package 4.3.0

 

Javadoc :

 

 C:\Program Files\Eclipse\plugins\net.rim.eide.componentpack4.3.0_4.3.0.8\components\docs\api

 

Java Home :

 

 C:\Program Files\Java\jdk1.6.0_07

Please use plain text.
Developer
spiv
Posts: 21
Registered: ‎10-09-2008
My Device: Not Specified

Re: Read JAD infos, ok but...

I have searched for rapc.exe. I have found two copies :

 

C:\Program Files\Eclipse\plugins\net.rim.eide.componentpack4.3.0_4.3.0.8\components\bin\rapc.exe

C:\Program Files\Research In Motion\BlackBerry JDE 4.5.0\bin\rapc.exe

 

I am pretty sure that eclipse is using the first one.

 

 

Please use plain text.
Administrator
MSohm
Posts: 14,437
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Read JAD infos, ok but...


 

Directory of Components :

 

BlackBerry JDE Component Package 4.3.0


That is what I was looking for, thanks!

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.