After you install the Eclipse, now it’s time for you to create new application. Start the Eclipse by open it in the start menu, point to ‘BlackBery Java Plug-in’ folder, and click on the ‘BlackBerry Java Plug-in’ program, which actually starting the Eclipse.
1. The workspace
Simply put, a workspace is a collection of projects or applications. To tell you the truth, I usually don’t feel comfortable at the idea of workspace, especially workspace concept in .NET, because I’m fixed on the idea that one application is one project. The concept of workspace usually makes me automatically raise a question: then what project will be run if I press compile + run? But anyway, almost every IDE has workspace concept built into their system, so let’s chill out.
Thank God, in Eclipse, the concept of workspace is much simpler. You just need to define a folder that will hosts all of your projects, and all of your projects will be treated as an individual project in here. At least that’s what it seems.
Eclipse will ask this automatically each time you run Eclipse. You can make him shut up by clicking on the ‘Use this as the default and do not ask again’ check box. Don’t worry, you can open this dialog box anytime you want from within the IDE menu later. For now on, just click OK, if you don’t want to make changes.
2. The IDE
After that, the IDE will open. Welcome to Eclipse! This screen will greet you each time you want to create Java-based application, especially BlackBerry apps, in our case.
One quick tour of important panes:
- The left pane is Project Explorer, which is based on whatever project you’ve put in the workspace path you’ve specified earlier. As we haven’t create any project at all, it makes sense it the pane is empty.
- The middle big pane is where our codes and visual design editor goes.
- The bottom long pane is where we can get feedback about our codes, such as any syntax errors or console output.
3. The Project
Now it’s the time for us to actually create the application! Click on the File menu –> New –> Project… It will open a dialog box titled ‘Select a Wizard’.
Well, too bad there’s no ‘Merlin’ or ‘Harry Potter’ as the choice of selection. Anyway, point to BlackBerry folder, and choose the BlackBerry Project. And click next.
In here, you just need to give the project a name. Put something on it, for example, our famous application ‘Hello World’. From here, you can actually click Next and set some other settings, but actually all of it is optional. That’s why the Wizard also gives you the option to ‘Finish’, and that’s what we’re going to do for now. Click ‘Finish’. The Eclipse will generate some basic application contents for you. It may open another last dialog for this process.
Perspective is just collection of ‘preset tools layout’ that has been prepared so that you can jump right in the developing and not worrying about where I can find what. To make your future life easier, click on the ‘Remember my decision checkbox, and click on Yes.
And voila! There is your first application, ready to be run. This application is still doesn’t have anything though, but it can be run right away.
4. The Device Simulator
Because your destination will be a smartphone device, of course it will be weird if you compile the program, and the result is a desktop application running at your OS. That’s why for developing on smartphones within Eclipse for BlackBerry and Android, and developing on iPhones within Xcode, you will encounter what’s called Device Simulator. It’s like virtualizing a physical BlackBerry device on your computer, complete with the latest OS based on your BlackBerry plug-ins. The OS we use in this simulator is BB OS 7. By the time this article written, there are another IDE called ‘Cascade’ that can be used to write apps for BB OS 10, but that’s outside of this tutorial’s scope right now. I suggest you to look it up on the internet if you want to learn the latest BlackBerry developing tutorial.
So, now, how to activate and run the device simulator? I remember it’s somewhat complex to set up and run a device simulator for Android, but it’s surprisingly easy to compile and run your application on BlackBerry device simulator. Contrary to what articles on the internet says, you just need to click on the Run menu –> Run As –> 1 BlackBerry Simulator. The Eclipse will open a BlackBerry device, which in our case, is from 9900 serial (Torch). It’s even complete with OS loading. I wish my BB was loading that fast!
After this, click on ‘All’ to open the application list.
Now scroll to the bottom. How to scroll to the bottom, you ask? Well, because this device is a simulator, you can expect it to work like the real thing. Click on the middle of the menu using your mouse pointer, and while you click it, drag to up. The app icons will scroll to the bottom, following your mouse pointer gesture.
Now you see that one app icon that really don’t belong there. The icon is too generic. Yes, that’s your newborn application, still fresh from the womb. Using your mouse pointer, click that icon. Click it!
And this is your app, still as clean as a white paper, ready for you to write anything you want there. We will learn further on the next chapter, where we will add some meat and bones to our app. Well, mainly bones at first. But, eventually, we will get there. Are you with me?