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
Highlighted
New Developer
Posts: 4
Registered: ‎09-24-2008
My Device: Not Specified
Accepted Solution

Installing multiple cod application with CodeModuleManager

Hi,

 

I'm trying to install a multiple cod application using CodeModuleManager.

As said by the javadoc, first cod file must be 64 Kb or less, the problem is it is not. I tried saving this first module in chunks but it doesn't make a difference, the result from CodeModuleManager.createNewModule(moduleSize, chunkBytes, chunkSize) is 0.

It doesn't matter how many times I recompile the application, I always end up with a first cod file around 90 KB and the rest ranging from 30 to 60 KB. The application has a total size of 300 KB.

 

I know CodeModuleManager works because I've tried installing single cod applications succesfully.

 

Does anyone have an idea about how to solve this?

 

Thank you, and hello by the way, it's my first post here!

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Installing multiple cod application with CodeModuleManager

Have you unzipped the COD? Some COD files are actually zero-compression ZIP files containing the actual modules, which are the ones you want to install.

 

Also, you may want to install such modules in the following order: first the ones with a dash, then the first one, the one without a dash in its name. This order seems to prevent an issue on some OSes, where alternate entry points contained in the very first module (the one without a dash) are started before its sibling modules are installed.

New Developer
Posts: 4
Registered: ‎09-24-2008
My Device: Not Specified

Re: Installing multiple cod application with CodeModuleManager

[ Edited ]

Yes, I already unzipped the file.

 

I tried installing first the ones with a dash (from -1 to -5) and then the one without a dash with the same luck Smiley Sad

 

Has anyone found the same problem?

 

I forgot to say that there's no problem installing it OTA from the browser, manually or invoking it.

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Installing multiple cod application with CodeModuleManager

Just wondering, are you using the CodeModuleManager API as outlined in the v5.0.0 javadocs: http://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/system/CodeModuleManager.html ?

New Developer
Posts: 4
Registered: ‎09-24-2008
My Device: Not Specified

Re: Installing multiple cod application with CodeModuleManager

Yes, I'm following that same process, but with API 4.5.

 

I've tried entering a lower value on the module size when I call CodeModuleManager.createNewModule(moduleSize, chunkBytes, chunkBytes.length) and it seems to work until the entered ammount is reached, but not when using the actual module size (306452). Is there a limit on module size? It doesn't make sense since it is perfectly possible to install the module from the browser...

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Installing multiple cod application with CodeModuleManager

[ Edited ]

It's impossible for a module to be 300 kB. You are probably trying to install a composite COD file, which is not a module but a ZIP file containing multiple modules. You need to install these (sibling) modules separately, invoking createNewModule, writeNewModule, and saveNewModule for each of them.

New Developer
Posts: 4
Registered: ‎09-24-2008
My Device: Not Specified

Re: Installing multiple cod application with CodeModuleManager

Thank you! That was it.

 

I thought I had to do the create-then-new process just once for the whole multiple-cod-module, not for each .cod.

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Installing multiple cod application with CodeModuleManager

You're welcome!