Development Guide

Local Navigation

Creating a BlackBerry application project from a template

Templates for BlackBerry application projects

You can use a template to create a basic BlackBerry® application project and then customize the code to suit your needs. You can also create your application from scratch by using an empty application template.

Template

Description

BlackBerry Application

This template creates a basic UI application that contains a single screen. The template creates two Java® source files, one for the application and one for the UI screen.

Hello BlackBerry

This template creates a UI application that contains a screen that is populated with some simple UI components. The template creates two Java source files, one for the application and one for the UI screen.

Empty Application

This template creates an empty BlackBerry device application.

Empty Library

This template creates an empty BlackBerry device library.

UI screen templates

You can use a template to create a basic UI screen and then customize the code to suit your needs. The BlackBerry® Java® Plug-in for Eclipse® provides templates for screen layouts that are typically used in BlackBerry device applications.

Template

Description

Main screen

This template extends the MainScreen class to provide UI features that are common to BlackBerry device applications.

Full screen

This template extends the FullScreen class to create a UI screen that contains one vertical field manager.

Popup screen

This template extends the PopupScreen class to provide features for building dialog and status screens.

Create a UI screen by using a template

Before you begin:

Create a BlackBerry® application project.

  1. In the Package Explorer view, expand a BlackBerry® application project.
  2. Right-click the src folder and click New > Other.
  3. Expand the BlackBerry folder and click BlackBerry Screen.
  4. Click Next.
  5. In the Name field, type a name for the .java file.
  6. In the Screen type drop-down box, select the type of UI screen that you want to create.
  7. Click Finish.

Create a UI application by using a template

  1. On the File menu, click New > BlackBerry Project.
  2. In the Project name field, type a name for the project.
  3. Select Create new project in workspace.
  4. Complete one of the following tasks:
    • To specify a specific JRE™, select Use a project specific JRE.
    • To specify the default JRE in the workspace, select Use default JRE.
  5. Click Next.
  6. Click Next.
  7. Click the template that you want to use.
  8. Click Finish.

Was this information helpful? Send us your comments.