|
Developing for BlackBerry – introductionBy Radu Motisan Posted on February 19th, 2009 , 2391 Views (Rate 1.51) |
Things described in this article:
- how to take screen captures from your Blackberry
- how to upgrade your BlackBerry's OS software
- what development tools you need if you want to code for BlackBerry
- a first Hello World app, including Basic controls, basic message handling, image loading and drawing
- how to upload an application to your BlackBerry and how to run it
First you should know that RIM's OS evolved in time, and that there are several versions available. My 8100 came with version 4.2 installed as you can see here:

If you need to take screen captures from your BlackBerry's screen, you might want to read this tutorial or download this tool directly.
Latest OS version for the 8100 was 4.5, so I decided to run the upgrade.
Here's another tutorial on how to do this. Here's another screenshot showing my current version:

Getting the right tools to develop my first application for BlackBerry was a real pain.
First I've tried the Visual Studio plugin for Blackberry, available on RIM's website. It worked in the simulator but it didn't work with the device - and it had nothing to do with the restricted APIs since I've only tried to put a button and display a messagebox. The compiled files were uploaded successfully to the 8100, but I couldn't find them in the programs list.
The second attempt was using Eclipse and the BlackBerry plugin. Lots of settings, if you are interested you can read more on that here. I gave it up when I managed to use the BlackBerry JDE.
So the easy way for me was to download the Blackberry JDE from this link. It also comes with a simulator in case you don't have a physical device to test.
I currently have the 4.2 version installed.
In the JDE, simply create a new Workspace, inside a new project, and there a JAVA file. You'll find some code you can use later in this post. Compiling your program will result in a .cod file. You can generate an ALX file from the menu Project->Generate ALX file. The cod and the alx can be used by the BlackBerry Desktop Manager to upload your program to the mobile device. It's straight forward, you'll manage to do this.
Alternatively you can use the Javaloader.exe to upload / delete your programs from the BlackBerry. Connect your BlackBerry to the PC via the USB Cable and use these parameters:
JavaLoader.exe -usb load your_program.cod
and to delete the program from the device:
JavaLoader.exe -usb erase -f your_program.cod
Once uploaded, your code will show up in the BlackBerry's programs list:

Regarding coding, you must know Java. But that's easy. My Java knowledge level was almost 0 when I've started doing this Hello World app, and by doing it, I was able to learn about creating controls dynamically ( new RichTextField), creating Timers (new Timer() .. timer.schedule ( new ToDoTask.. ), loading images (Bitmap.getBitmapResource("helloworld_jde.png")), handling paint events (public void paint(Graphics g) ) and handling user's key inputs (public boolean keyChar(char key, int status, int time) ).
|
The sample, including the .cod file can be downloaded here: helloworld-bjde Basically you have everything you need there, to start doing a simple game of some kind. And compared to Window Mobile C++ win32 API programming it's easier. But not as powerful. |
|
|
























January 11th, 2012 at 8:42 pm
[...] Radu Motisan Posted on January 11th, 2012 Some time has past since my first experience with Blackberry. 3 years! It's the same boring and limited platform, but at least the tools have [...]
May 19th, 2013 at 12:10 pm
[...] In a world dominated by Android and iOS, how hard is it for another mobile platform, be it one bearing the glory of the past, to reconquer the market shares it once had? It's all about marketing, a bit of luck, but from my point of view (not generally applicable, see how iOS started), the technology involved – the actual value resulting from the time and effort invested in making something better. Blackberry has reinvented itself in a new, fierce competitor with its latest release, the Blackberry 10. The handsets running the new OS are impressive: huge 768 x 1280 pixel screens, 8Mega pixel camera (with geotagging and face detection), 2GB of Ram memory and a Dual-core 1.5 GHz Krait processor. A beast in terms of hardware capabilities but also a huge step forward. [...]