0

I am building a Cordova / Blackberry app and am struggling to load the program on my device for testing.

When I first built the phonegap code it required 54 code signatures when running ant blackberry load-device with 50 signatures this fails 7 out of every ten tries. (No response comes back from the BB servers and it never finishes building).

After some more work on the app I went to test on the device today and suddenly find that I now need 642 signatures. This is never going to work.

How does blackberry decide how many signatures I need? How can I get that back down to a manageable level?

Alex C
  • 16,624
  • 18
  • 66
  • 98

1 Answers1

1

The size of your app largely determines this.

When you build a BlackBerry app, it gets packaged into a .cod file. But, in almost all cases, that single .cod file is actually a container of smaller .cod files. If you rename the single .cod file that results from your build, (e.g. from MyApp.cod to MyApp.zip), you can actually unzip it with normal unzipping tools, and see what's inside.

The larger your app's binary size, the more small cod files will be created inside this outer .cod container. I can't remember all the legacy for this, but basically, the build tools will split up the app into lots of little cods, to keep each one below about 64KB. (I think this was because of network download limits.) So, the bigger the app, the more cods.

Code signing will need to be applied to each cod (and I think it happens 3x per cod).

The total size of your app will depend on how much code you have, and especially, the size of your bundled resources, like images. You can certainly use fewer images, and compress them more (e.g. with PNGCrush). Or, you might decide to let your app download some of this bundled content at runtime. Obviously, that's trading app size for runtime performance. I wouldn't generally recommend that just to avoid the codesigner spam, but it is an option.

Which OS you use to compile your app may also contribute to the size. If you don't need to support OS 5.0 anymore, and you've been building with the 6.0 base OS version, you might consider dropping down to 5.0 to minimize the final size of your app. That, of course, assumes that you can do this, and that you don't depend on 6.0 or 7.x features.

But, I know some people have stopped supporting older OS versions, when they probably could still be doing so. Anyway, I don't think this will make as big a difference to you as the bundled images.

Incidentally, I've only had occasional problems with the BlackBerry code signing servers timing out. Is it possible that your development machine has a flaky internet connection? You can try looking here for near realtime information about the signing servers' online status

Here's a couple other things to read:

http://supportforums.blackberry.com/t5/Java-Development/Issues-with-the-maximum-number-of-CODs-for-an-app/m-p/1237881

Optimizing for a smaller .cod (.jar) file

http://supportforums.blackberry.com/t5/Testing-and-Deployment/The-maximum-size-of-a-BlackBerry-smartphone-application/ta-p/1300209

Community
  • 1
  • 1
Nate
  • 31,017
  • 13
  • 83
  • 207