Primera aplicación bb

Solo disponible en BuenasTareas
  • Páginas : 6 (1457 palabras )
  • Descarga(s) : 0
  • Publicado : 3 de noviembre de 2011
Leer documento completo
Vista previa del texto
Page | 1

A10 – Writing Your First Application
for BlackBerry

Page | 2

Contents
A10 – Writing Your First Application ......................................................................................................... 3 Introduction ............................................................................................................................................. 4Development ........................................................................................................................................... 5 Setting up New BlackBerry Project ...................................................................................................................... 5 Configuring Your New BlackBerry Project........................................................................................................... 7 Creating HelloWorld Class ................................................................................................................................... 9 UiApplication ..................................................................................................................................................... 11 MainScreen........................................................................................................................................................ 14 Running Application in the Simulator ................................................................................................................ 16 OtherVariations..................................................................................................................................... 18 Links ...................................................................................................................................................... 19

Page | 3

A10 – Writing Your First Application
This tutorial will show you how to write a basic application for BlackBerry devices. The application will display the simple “HelloWorld” message on the screen. To be able to do so it is required to have the following installed on your system: • • • • Sun JDK Eclipse SDK, BlackBerry JDE Plug-in for Eclipse and BlackBerry JDE Component Packs 4.3 – 4.7

If you need help setting up please look at A1 – Setting up Tools tutorial. If you are ready, launch the Eclipse, and go to your Workbench (Figure 1).

Figure 1

Page | 4Introduction
In this tutorial I will show you the following: • • • • • How to setup and configure new BlackBerry project, How to create classes, Some details about UiApplication and MainScreen, How to write a Hello World application and How to run your application in simulator.

Please note that you can always find more information about the APIs we are using in BlackBerry API referencedocument, which is the part of any JDE Component Pack (Figure 2). You can find it on your computer under Start / Programs / Research in Motion / BlackBerry JDE 4.x.

Figure 2

Page | 5

Development
Setting up New BlackBerry Project
To setup your new BlackBerry project: 1. Click on File/New/Project menu. 2. Select BlackBerry project (Figure 3).

Figure 3

3. Click Next. 4. Chose Projectname and location (Figure 4).

Page | 6

Figure 4

5. Enter the project name, i.e. “Hello World“. 6. Select your location or use a default one to store your project. 7. Click Finish.

Page | 7

Configuring Your New BlackBerry Project
To configure your new BlackBerry project: 1. Click on BlackBerry/Configure Blackberry Workspace. 2. Click on the BlackBerry Workspace and insert your Vendorand Version data (Figure 5).

Figure 5

3. Here you can change a number of different settings. Let’s just enter version number 1.0 and vendor “TestVendor”. 4. From BlackBerry JDE, select Installed Components

Page | 8

Figure 6

5. Chose component package – 4.6.0 (Figure 6). 6. Click OK.

Page | 9

Creating HelloWorld Class
To start developing our application after setting up...
tracking img