10-27-2009 05:47 AM
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!
Solved! Go to Solution.
10-27-2009 06:02 AM
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.
10-27-2009 06:20 AM - edited 10-27-2009 06:24 AM
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
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.
10-27-2009 06:37 AM
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
10-27-2009 11:57 AM
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...
10-27-2009 12:00 PM - edited 10-27-2009 12:02 PM
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.