Setup BlackBerry OTA Applications

From Blackberry Insight

Apache Version

Setting up OTA downloads for the BlackBerry is pretty easy. Technically, this is done by uploading your program’s files to a web server
and storing it there in a directory that is accessible from the web.

The most famous free web server that powers the Internet is called Apache - from the Apache HTTP Server Project. It is available for many platforms including the most common Windows (all versions), Linux, *BSD, Solaris, Mac OS X, and even more. All information you need to install the Apache web server you can find over here. Check out the complete documentation for more.

Let’s say your server is called http://www.blackberryinsight.com and you want to place your BlackBerry application called BBCalls directly on that domain; you would get an OTA download link like www.yourdomain.com/bbcalls.jad.

Therefore, you first need to upload your OTA program files to your web server. Technically there are two files for each application; in our case this would be:

  1. bbcalls.jad: JAD = Java Application Descriptor; a text file that describes your application.
  2. bbcalls.cod: the actual program file; in binary format which can only be executed by the BlackBerry.

Once you uploaded those two files to your web server (e.g. via FTP) you should be able to access them via the following URLs:

  • www.yourdomain.com/ bbcalls.jad
  • www.yourdomain.com/ bbcalls.cod

However, you will still not be able to access those URLs from your BlackBerry and install the application. Your web server needs to know more about the content of those files. This is called “MIME Type” and has actually been created for emails many years ago. Anyway, the MIME type setting is important as the web server will then understand which content this is, so it knows how to deliver those files to your BlackBerry browser. The web server is also telling the BlackBerry browser which kind of MIME type will come in the file you want to download. This helps your BlackBerry browser to determine what to do with the data that will be downloaded. For example: an .html file will be shown in the browser, a .jpg file will be downloaded to your “Pictures” directory, a .avi file will be downloaded to your “Videos” directory, and a .jad file will tell the browser to install a new application.

notepad_htaccess.png

The easiest way to set up the MIME type for our two file types
(.jad and .cod; see above) can be done in a file called .htaccess. This is basically just a normal text file which can be created or edited in any kind of text editor like Notepad on your Windows desktop. Here is an example of a simple .htaccess file:

AddType text/vnd.sun.j2me.app-descriptor .jad
AddType application/vnd.rim.cod .cod

This is all you need. Now just upload your .htaccess file to the same directory where you placed your .jad and .cod files at.

You should now be able to install your application via the above mentioned OTA download link directly with your BlackBerry browser.

In case it doesn’t work: It is important that your web server allows directory based overrides. So the Apache must have been set to “Allowoverride All” for example. For more detailed information on how to set up an .htaccess file please refer to Apache Tutorial: .htaccess files.

For advanced web server admins: You can also set this up in your web server’s main configuration file. In most cases (if you are on a shared hosting plan for example) you do not have access to this file. In case you have access and want to change the mime type setting for your server globally you need to change the main configuration file (mostly called apache2.conf or httpd.conf). for more on this topic please click here.

Microsoft IIS Webserver

Note: This HowTo should be considered as extension to the HowTo: Setup an Apache Webserver to deliver BlackBerry OTA Applications which describes why you need to set MIME types in your web server. Here is what you should do if you are running an IIS.

Microsoft IIS provides a GUI for setting up MIME types. Below lists the steps for setting up MIME types with IIS 5.0 on Microsoft Windows 2000 Professional:

  1. Bring up the Internet Information Services window by selecting Control Panel -> Administrative Tools -> Internet Service Manager.
  2. In the tree on the left-hand side, you should see an item whose caption is your computer’s name. Right-click on it to pop up a menu.
  3. Click Properties in the menu to bring up the Properties window.
  4. Click the Edit button located in the Computer MIME Map frame to bring up the File Types window.
  5. In the File Types window, you can see a list of MIME mappings. Use the buttons labeled “New Type…”, “Remove” and “Edit…” to make any changes you want.

The steps for setting up MIME types with other versions of IIS should be similar.

If your IIS is of version 3.0 or below, the procedure is less user-friendly. It involves editing the registry at the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ Services\InetInfo\Parameters\MimeMap.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License