Over-the-Air Installation BLACKBERRY

The BlackBerry browser can be used to install a BlackBerry application from any web site that’s accessible from the BlackBerry. For the most part, this means anywhere on the Internet or the corporate intranet if the device is activated on a BES. This is called over-the-air (OTA) installation.

Sibling COD Files

BlackBerry applications are compiled into COD files (with the extension .cod). When a compiled application contains more than 64KB of code or static data (including, among other things, resource files and static string data), the BlackBerry compiler breaks the COD file up into two or more COD files, naming them in increasing numerical order. For example, if we add bunch of images to our UiFun application, the COD files would be named as follows:

UiFun.cod
UiFun-1.cod
UiFun-2.cod
UiFun-3.cod
...

The compiler then takes these COD files, which are known as sibling COD files, and adds them all to a zip archive, which is then named the same thing as the first COD file: UiFun.cod. The point of all this is that if a user is trying to download a COD file OTA containing sibling COD files and isn’t connecting through the BES/MDS, the application will fail to install. So, what we have to do in this case is unzip the main COD file and deploy all the sibling COD files to the web server instead. The steps for our example would be as follows:

  1. Rename UiFun.cod to UiFun.zip.
  2. Using a zip file program or the built-in Windows support for zip files, unzip the COD files.
  3. Deploy the unzipped COD files to the web server—not the original zip file.

Note that if step 2 fails with a message that the zip archive is invalid, then you don’t have sibling COD files and can safely deploy the single COD file to the web server.

The JAD File

Over-the-air installation requires a descriptor file called a Java application descriptor (JAD) file, which is a structured text file with the extension .jad.

Both the JDE and the JDE Plug-in for Eclipse generate JAD files automatically with your build. The JAD file will be named the same thing as your base COD file name, but with a .jad extension. Since a JAD file is just a text file, you can use any text editor to change the contents.Here’s an example UiFun.jad file:

Manifest-Version: 1.0
MIDlet-Version: 1.0.1
MIDlet-Jar-Size: 395389
RIM-COD-URL-3: UiFun-3.cod
RIM-COD-SHA1-3: ff fb 53 97 7d 45 55 46 4b 0b 62 b5 8c 64 22 72 89 12 0f 4f
RIM-COD-URL-2: UiFun-2.cod
MicroEdition-Configuration: CLDC-1.1
MIDlet-Jar-URL: UiFun.jar
RIM-COD-Module-Dependencies: net_rim_cldc
RIM-COD-SHA1-2: a3 43 1d c9 fa b3 dc 74 af 9c 96 ea 8a 30 55 84 dd 0d 39 8e
RIM-COD-URL-1: UiFun-1.cod
RIM-COD-SHA1-1: 04 02 d3 d0 ef a3 1a 88 b5 bd a5 c1 9d b6 23 d6 9d 52 00 37
RIM-COD-Size-3: 29240
RIM-COD-Size-2: 56696
RIM-MIDlet-Flags-1: 0
RIM-COD-Size-1: 54096
RIM-COD-Module-Name: UiFun
MIDlet-Name: UiFun
RIM-COD-Size: 60208
RIM-COD-Creation-Time: 1250882363
MIDlet-1: UI Fun Application,,
RIM-COD-URL: UiFun.cod
MIDlet-Description: The Beginning BlackBerry UI Fun Application
RIM-COD-SHA1: b4 6b f1 d5 91 88 4a 8e e5 6a 40 8a 7b 12 5d 93 d1 20 bb 44
MicroEdition-Profile: MIDP-2.0
MIDlet-Vendor: Anthony Rizk

You can safely change a few of these values in the file—including MIDlet-Vendor and MIDlet-Description—but generally it’s better to let the development tools take care of it. Later another way of generating JAD files using Apache Ant.

Content Types (MIME Types)

Before being able to download an application OTA from a web server, the web server needs to send the correct content types, or MIME types,along with the JAD and COD files.describes these types.

MIME Types

Content Types (MIME Types)

How you set these types varies depending on your web server—consult your server administrator or hosting provider for more information.

Uploading Your Application

The last step to complete the setup of your OTA download is to upload your JAD file and your COD files to your web server. Make sure that your JAD file and COD files are all accessible at the same level of the web server.Users will only have to worry about the location of the JAD file, but the BlackBerry will need to access all the COD files as well.

Downloading the Application

Once all of these things are taken care of, you just have to open your BlackBerry browser and enter the URL to the.jad file into the web address field, and you will be shown a page that lets you download the application to your device.

Over-the-air download—notice the application properties we set earlier.

Over-the-air download—notice the application properties we set earlier.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

BLACKBERRY Topics