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.
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).
Step 3
After login, you will be redirected to download page and click download button.
Step 4
Double click on the downloaded file to install it.
Step 5
Click next to proceed the installation
Step 6
Chose accept and click next.
Step 7
Chose the destination place where you want to install the eclipse and click next.
Step 8
If you do not want to create shortcut on desktop and programs means uncheck those check boxes and click next.
Step 9
Click Install.
Step 10
Click Done.If you get this error message means you have to download the latest version of JRE and install and run the eclipse.
Your eclipse will start like this.
Step 11
Chose the destination folder for your workspace and click the check box to avoid this message on future use.
Step 12
Your eclipse will opens like this.
Creating Hello World Project
Step 1
Click File -> New -> Blackberry Project
Step 2
Enter your project name and click Finish.
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.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);
}
}
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
Step 5
Your blackberry simulator will open like this.
Step 6
Here click “All” and swipe or scroll down to your “HelloBlackBerry” application and click on it to open.
Step 7
You can see the “Hello Blackberry” on the screen and the “My First Application” on the title.
No comments:
Post a Comment