Polishing the Application BLACKBERRY

Now that we’ve created and run our first application in the JDE or Eclipse (or both), we’ll finish off by adding a few bits of polish: the application icon and a slightly friendlier name.

Setting the Title in Project Properties

The application title and version are both accessed through the project properties dialog, which is in almost the same place in both development environments. In the JDE, it’s accessed by right-clicking the project and selecting Properties. In Eclipse, it’s accessed by right-clicking the name of the project in the left-hand pane, selecting properties and clicking BlackBerry Project Properties in the list on the left side. If you don’t specify an application title, the BlackBerry will use your project name as the title of the application on the home screen. In our case, we want a space between Hello and World and add an exclamation point to make it more exciting, so type Hello World! in the Title field.

The properties dialog for the HelloWorld project

The properties dialog for the HelloWorld project

Creating an Icon

A BlackBerry icon should be a PNG image. Because there are different screen resolutions, the image size will depend on the devices you want to support, though 48 × 48 pixels is reasonable for most devices (many older ones will scale it down). For more information about ideal icon sizes for different devices you can refer to the BlackBerry UI Guidelines. The easiest way to find them is to search the BlackBerry Developer Zone

Adding an Icon with the JDE

Using the JDE, you must add the icon’s image file to the project before using it as your application icon. Save the file to a directory under your project. Then from the Project menu, select Add File to Project, and browse for your icon file. Your workspace should now list icon.png on the left side.

The application icon added to the JDE project

The application icon added to the JDE project

Now, right-click the icon, and select Properties. Select the Use As Application Icon check box in the File Properties dialog.

Setting icon.png to be used as the applicaton’s icon

Setting icon.png to be used as the applicaton’s icon

Adding an Icon with the JDE Plug-in for Eclipse

The JDE Plug-in doesn’t require you to add the icon to the workspace before making it the application icon.In fact, the icon’s image file doesn’t even have to be in the project directory (though storing it with the project is highly recommended, as it makes managing everything easier). Right-click your project, and select Properties to open the project properties, dialog. Then, click BlackBerry Project Properties, followed by the Resources tab, and click the Add button under “Icon files”. Then browse for your icon.

Adding the Hello World application icon in Eclipse

Adding the Hello World application icon in Eclipse

Seeing It All in Action

Now, go ahead and run the simulator again. Our fancy new icon and more user-friendly name will be displayed on the home screen, just like in Figure!

The shiny new Hello World!

The shiny new Hello World!



Face Book Twitter Google Plus Instagram Youtube Linkedin Myspace Pinterest Soundcloud Wikipedia

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

BLACKBERRY Topics