Thursday, July 5, 2012

Get Started Developing for BlackBerry.

Get Started Developing for Blackberry with Eclipse


Download & Installation

Step 1
Click here to the site where you can download the Blackberry 7 SDK and click on the highlighted link to download the file.
Blackberry SDK setup

Step 2
The previous page will navigate you to a login screen where you can enter your credentials and login (If you don’t have one, register for a new one).
Blackberry SDK setup

Step 3
After login, you will be redirected to download page and click download button.

Blackberry SDK setup

Step 4
Double click on the downloaded file to install it.

Blackberry SDK setup

Blackberry SDK setup

Step 5
Click next to proceed the installation

Blackberry SDK setup

Step 6
Chose accept and click next.

Blackberry SDK setup

Step 7
Chose the destination place where you want to install the eclipse and click next.

Blackberry SDK setup

Step 8
If you do not want to create shortcut on desktop and programs means uncheck those check boxes and click next.

Blackberry SDK setup

Step 9
Click Install.

Blackberry SDK setup

Blackberry SDK setup

Step 10
Click Done.
Blackberry SDK setup

If you get this error message means you have to download the latest version of JRE and install and run the eclipse.
Blackberry SDK setup

Your eclipse will start like this.
Blackberry SDK setup

Step 11
Chose the destination folder for your workspace and click the check box to avoid this message on future use.
Blackberry SDK setup

Step 12
Your eclipse will opens like this.
Blackberry SDK setup

Creating Hello World Project

Step 1
Click File -> New -> Blackberry Project
Blackberry SDK setup

Step 2
Enter your project name and click Finish.
Blackberry SDK setup

Step 3
In you package explorer you can find “mypackage” under your project source which contains two class files named “MyApp.java” and “MyScreen.java”. Here “MyApp.java” is your main application class and “MyScreen.java” is your application screen class.
Blackberry SDK setup

Double click on the “MyScreen.java” and replace the following code in it.

package mypackage;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.MainScreen;

public final class MyScreen extends MainScreen
{
LabelField lbl = new LabelField();
public MyScreen()

// Set the displayed title of the screen 
setTitle("My First Application");

lbl.setText("Hello Blackberry");
add(lbl);
}
}

Here I have added a label field and assigned the text as “Hello Blackberry”. I have changed the screen title as “My First Application”.

Step 4
Right click on the screen and select Run As  BlackBerry Simulator

Blackberry SDK setup

Step 5
Your blackberry simulator will open like this.
Blackberry SDK setup

Step 6
Here click “All” and swipe or scroll down to your “HelloBlackBerry” application and click on it to open.
Blackberry SDK setup

Step 7
You can see the “Hello Blackberry” on the screen and the “My First Application” on the title.
Blackberry SDK setup

No comments:

Post a Comment