ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

BlackBerry


Enviado por   •  8 de Junio de 2013  •  1.397 Palabras (6 Páginas)  •  181 Visitas

Página 1 de 6

Page | 1

A10 – Writing Your First Application

for BlackBerry

Page | 2

Contents

A10 – Writing Your First Application .........................................................................................................3 Introduction.............................................................................................................................................4 Development ...........................................................................................................................................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 Other Variations.....................................................................................................................................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 “Hello World” 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 | 4

Introduction

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 reference document, 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 Project name 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 Vendor and 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 and configuring our Workspace, we need to create a new HelloWorld Class:

1. Click on File/New/Package (Figure 7).

2. Enter the package path i.e. com.rim.samples.helloworld.

3. Click on Finish button.

4. Click on File/New/Class (Figure 8)

Figure 7

Page | 10

Figure 8

5. Check the source folder

...

Descargar como (para miembros actualizados)  txt (11.1 Kb)  
Leer 5 páginas más »
Disponible sólo en Clubensayos.com