Chinaunix首页 | 论坛 | 博客
  • 博客访问: 783514
  • 博文数量: 738
  • 博客积分: 7000
  • 博客等级: 少将
  • 技术积分: 5000
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-12 09:00
文章分类

全部博文(738)

文章存档

2011年(1)

2008年(737)

我的朋友

分类:

2008-09-12 09:08:59


  1.系统要求
  
  Pentium 100以上CPU
  
  64MB 内存
  
   NT Workstation 4.0(Service Pack 3)或 98
  
  6MB自由硬盘空间
  
   2 SDK, Standard Version, 版本1.2.2或者更高
  
  2.安装 2 SDK
  
  在使用Motorola SDK之前必须安装JDK,Standard Edition。请从 JDK,并按照Sun的指导安装到PC中。
  
  3.安装Motorola SDK
  
  安装之前请先卸载以前版本的Motorola SDK:
  1. 选择"开始à设置à控制板"
  2. 选择"添加/删除程序"
  3. 查找到"Motorola SDK Components for the J2ME Platform"
  4. 点击"卸载"
  5. 用资源管理器删除"\MotoSDK"目录
  
  安装SDK:
  1. 运行"Motorola_SDK.exe"
  2. 按照提示安装程序
  注意:安装程序需要口令,请向Motorola公司索取。
  
  4.编写第一个程序
  
  在目录"\MotoSDK\demo\midlets\com\mot\j2me\midlets\tutorials\"中,用编辑器创建文件"HelloWorld.java"。
  
  /*
  * HelloWorld.java
  *
  * June 27, 2000
  *
  * ? Copyright 2000 Motorola, Inc. All Rights Reserved.
  * This notice does not imply publication.
  */
  
  package com.mot.j2me.midlets.tutorials;
  
  import javax.microedition.lcdui.*;
  import javax.microedition.midlet.*;
  
  /**
  * A simple Hello World midlet
  *
  * @see MIDlet
  */
  
  public class HelloWorld extends MIDlet {
  /**
  * Main application screen
  */
  
  private Form mainScreen;
  /**
  * A reference to the Display
  */
  
  private Display myDisplay;
  /**
  * Creates a screen for our midlet
  */
  
  HelloWorld() {
  myDisplay = Display.getDisplay(this);
  mainScreen = new Form("Hello World");
  /*
  * Create a string item
  */
  StringItem strItem = new StringItem("Hello", "This is a J2ME MIDlet.");
  mainScreen.append(strItem);
  }
  
  /**
  * Start the MIDlet
  */
  public void startApp() throws MIDletStateChangeException {
  myDisplay.setCurrent(mainScreen);
  }
  
  /**
  * Pause the MIDlet
  */
  public void pauseApp() {
  }
  J2ME开发步骤
  
  /**
  * Called by the framework before the application is unloaded
  */
  public void destroyApp(boolean unconditional) {
  }
  
  }
  
  5.编译
  
  编译"HelloWord"
  1.在命令行窗口中,进入目录"\MotoSDK\demo\midlets"
  2.输入"compileAll com\mot\j2me\midlets\tutorials\HelloWorld.java"
  
  6.运行
  
  运行"HelloWord"
  1.在命令行窗口中,进入目录"\MotoSDK\scripts"
  2.输入"runEmul com.mot.j2me.midlets.tutorials.HelloWorld"
【责编:admin】

--------------------next---------------------

阅读(387) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~