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

Web and WebWorks Development

Reply
Developer
araskin
Posts: 128
Registered: ‎08-01-2008
My Device: Bold 9900, 9810, 9780, 9650 and so many others
My Carrier: T-Mobile
Accepted Solution

Why multiple COD files?

Hi Everyone,


I compiled a small test app for WebWorks 7.0 and I noticed that in the OTAInstall there are 6 COD files and a JAD file. Why are there so many COD files? Which files should I try to install on my 9900 7.1 device?

 

Regards,


Alon

Please use plain text.
BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: Why multiple COD files?

Hello Alon,

 

This has to do with the maximum COD file size:

http://supportforums.blackberry.com/t5/Testing-and-Deployment/The-maximum-size-of-a-BlackBerry-smart...

 

Specifically, one COD file is limited to 64kb of source code and 64kb of resources; these two pools of space can not be shared (i.e. unused resource space can not be used as source code space.)

 

When one of those limits are exceeded, a new COD file is created to hold the remaining content, up to a maximum of 127 sibling COD files.

 

If you look at the Standard install COD file, you can actually open that COD file with an archive editor (WinRAR, WinZip, etc.) and you'll actually find the same sibling COD files contained inside the larger COD file. In reality, that large COD file is actually just a renamed ZIP file that houses all the COD files.

 

So why do this?

 

Well, when the larger (archive) is installed through USB, Desktop Manager and the command-line tools know to provide each COD file in sequence from the archive, and each is installed properly.

 

However, when installing OTA, while some web servers know how to perform this communication, often times they do not, and if the full (archive) COD is attempted to be installed OTA, it will fail. Even in those cases where the server is smart enough to perform this communication, it actually sends the ENTIRE archive for each sibling. Meaning:

  • Device requests sibling #1.
  • Server sends entire archive and device extracts/installs sibling #1.
  • Device requests sibling #2.
  • Server sends entire archive and device extracts/installs sibling #2.
  • etc.

You can see that, for a very large archive with many sibling CODs, this can result in a LOT of unnecessary traffic. Therefore, when hosting OTA, the recommendation is to host the ALX file, and ALL sibling COD files that are found in the OTAInstall folder.

 

Alternatively, you could UNZIP the ARCHIVE COD and use those sibling CODs (along with the ALX file) as well, but you should NOT host the entire ARCHIVE COD online.

 

All of that being said, if you are using JavaLoader to deploy, you can actually call the command on the JAD file to perform the install:

javaloader -u install myapp.jad

 

Similar to how it works OTA, the JAD file is a text descriptor of all the required COD files for the application and JavaLoader can use that information to install each file as required.

 

 

There's quite a bit of information up there, so please let me know if something doesn't make sense.


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Please use plain text.
Developer
araskin
Posts: 128
Registered: ‎08-01-2008
My Device: Bold 9900, 9810, 9780, 9650 and so many others
My Carrier: T-Mobile

Re: Why multiple COD files?

Brilliant. Makes perfect sense. Thank you.

Please use plain text.