Howto: Setup an Apache Webserver to deliver BlackBerry OTA Applications


Note: IIS users / administrators might want to check out Howto: Setup a Microsoft IIS Webserver to deliver BlackBerry OTA Applications.

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.

Therefor, you first need to upload your OTA program files to your web server. Technically this 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

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 Example .htaccess - Setup BlackBerry OTA Downloads
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 of your desktop Windows. 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 diretly 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.

Important Note: Do not upload commercial program files from other companies to your server. By doing this, respectively publishing the download link and therefor the program itself will be considered as software piracy by nearly every country’s law.


Get our articles via email:

Looking for Software for your BlackBerry? BlackBerryInsight Software Store!

Tags: , , , , , , , , , , , , ,

17 Responses to “Howto: Setup an Apache Webserver to deliver BlackBerry OTA Applications”

  1. [...] Howto: Setup an Apache Webserver to deliver BlackBerry OTA Applications Note: IIS users / administrators might want to check out Howto: Setup a Microsoft IIS Webserver to deliver BlackBerry OTA Applications. 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 [...]

  2. [...] Howto: Setup an Apache Webserver to deliver BlackBerry OTA …that powers the Internet is called Apache from the Apache HTTP Server … .htaccess … file please refer to Apache Tutorial: .htaccess files. [...]

  3. [...] 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 [...]

  4. [...] it in the directory with the files, this will solve your problem. He is a nice guide to help you. Howto: Setup an Apache Webserver to deliver BlackBerry OTA Applications | BlackBerryInsight http://www.BlackBerryBoards.com "The [...]

  5. Jamie says:

    This worked great for me! Thanks!

  6. [...] OTA, have you created a .htaccess as described here: Howto: Setup an Apache Webserver to deliver BlackBerry OTA Applications | BlackBerryInsight __________________ ~rb BlackBerry ? Storm 9530 – [...]

  7. Hi! We have configured the .htaccess file as shown, and verified with our ISP that the server does the AllowOverride All setting.

    Error: invalid manifest or application descriptor. the MIDlet Version attribute is not a valid version number.

    Any suggestions would be appreciated.

    Thanks in advance!

  8. wael says:

    what should i name the .htaccess file .. like 1.htaccess or what? thank you

  9. Edward says:

    I’m not sure what i’m doing wrong, I set the .htaccess file as:

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

    But everytime i open the link to the .jad file, it opens up the coding of the .jad file and doesn’t allow the installation, can someone please help explain how to fix this?

    Thanks in advance.

  10. k says:

    Check if your webserver’s config is set to “Allowoverride All” which allows the usage of .htaccess files :)

  11. Edward says:

    Hello K,

    Thanks for the input, can you tell me how i can check the webserver config and how i can set it to allowoverride all?

  12. Edward says:

    K,

    Would i need to download & install Apache server into my Windows Vista?

  13. Krystal says:

    I really need help! I am trying to make a blog to post my themes. I downloaded apache but I dont know what to do now. I dont seem to understand how to create the link for my files?

  14. [...] Likely your web server is not sending the correct MIME types for .jad and .cod files, as documented in Installing BlackBerry Java Applications Using the Web Browser. How you do this depends on your web server, but for Apache web servers you can do this by following the instructions in How to Setup an Apache Web Server to Deliver BlackBerry OTA Applications. [...]

Leave a Reply