黑莓开发之环境的搭建

入手黑莓开发 ,第一步肯定是搭建环境了,黑莓提供了自己的JDE开发工具,但是个人以为十分之不方便,还是选择eclipse插件比较好,黑莓官网的服务器在加拿大 ,访问速度慢如蜗牛,这里我给迅雷下载地址:

http://bbsdk.csdn.net/BlackBerry_JDE_PluginFull_1.1.2.201004161203-16.exe

下载之后,按照默认安装即可

安装好了之后 ,按照开发习惯,先写一个helloWorld小例子,打开eclipse,点击File-new,选择project,然后选择blackberry project ,工程名HelloWorld,建好之后就可以编辑代码了

public class MyApp extends UiApplication {
	/**
	 * Entry point for application
	 * 
	 * @param args
	 *            Command line arguments (not used)
	 */
	public static void main(String[] args) {
		// Create a new instance of the application and make the currently
		// running thread the application's event dispatch thread.
		MyApp theApp = new MyApp();
		theApp.enterEventDispatcher();
	}
	/**
	 * Creates a new MyApp object
	 */
	public MyApp() {
		// Push a screen onto the UI stack for rendering.
		pushScreen(new HelloWorldScreen());
		//new MenuCanvas();
	}
}
final class HelloWorldScreen extends MainScreen {
	public HelloWorldScreen(){
    	super();
    	LabelField title = new LabelField("HelloWorld", LabelField.ELLIPSIS);
    	setTitle(title);
    	
        add(new ButtonField("Submit"));
    }
	public boolean onClose() {
		//Status.show("Hello World!");
		Dialog.ask(Dialog.D_OK_CANCEL, "are you sure?", Dialog.NO);
		System.exit(0);
		return true;
	}
}

这样直接在虚拟机运行就ok啦!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值