手持移动设备应用发-课程设计说明书.docVIP

  • 6
  • 0
  • 约3.52万字
  • 约 20页
  • 2016-10-06 发布于贵州
  • 举报

手持移动设备应用发-课程设计说明书.doc

手持移动设备应用发-课程设计说明书

苏 州 市 职 业 大 学 课程设计说明书 名称_手持移动设备应用开发课程设计 目录 一、课程设计目的与要求 1 1.1 设计目的 1 1.2 设计要求 1 1.3 设计内容简介 1 二、开发环境与系统流程 2 2.1.开发平台构建 2 2.2.系统流程图 2 三、详细设计与分析 2 3.1服务器端主程序设计 2 3.2服务器端读取客户信息线程设计 3 3.3服务器端收发线程设计 3 3.4客户端主界面设计 3 3.5客户端发送/接收信息设计 3 四、系统调试和运行 3 六、课程设计总结 3 七、参考文献 4 附录(源程序代码) 4 一、课程设计.1.开发平台构建 JDK由一个标准类库和一组建立,测试及建立文档的Java实用程序组成。其核心Java  Eclipse是一个开放源代码的软件开发项目,专注于为高度集成的工具开发提供一个全功能的、具有商业品质的工业平台。它主要由Eclipse项目、Eclipse工具项目和Eclipse技术项目三个项目组成,具体包括四个部分组成——Eclipse Platform、JDT、CDT和PDE。EclipseME是一个用来开发J2ME应用程序的Eclipse插件。EclipseME集成了Eclipse现有的java editor功能,提高代码的编写效率.2.系统流程图 图5 三、详细设计与分析 3.1主界面程序设计 public SocketMIDlet() { display = Display.getDisplay(this); f = new Form(Socket Demo); cg = new ChoiceGroup(Please select peer, Choice.EXCLUSIVE, names, null); f.append(cg); portField = new TextField(Port number:, String.valueOf(DEFAULT_PORT), 6, TextField.NUMERIC); f.append(portField); f.addCommand(exitCommand); f.addCommand(startCommand); f.setCommandListener(this); display.setCurrent(f); } 图6 3.2服务器端界面程序设计 public Server(SocketMIDlet m, int p) { parent = m; port = p; display = Display.getDisplay(parent); f = new Form(Socket Server); si = new StringItem(Status:, ); tf = new TextField(Send:, , 30, TextField.ANY); f.append(si); f.append(tf); f.addCommand(exitCommand); f.setCommandListener(this); display.setCurrent(f); } 图7 3.3服务器端接收信息程序设计 } } while (((c = is.read()) != \n) (c != -1)) { sb.append((char) c); } if (c == -1) { break; } si.setText(Message received - + sb.toString()); } stop(); si.setText(Connection is closed); f.removeCommand(sendCommand); } catch (IOException ioe) { if (ioe.getMessage().equals(ServerSocket Open)) { Alert a = new Alert(Server, Port + portString + is already taken., null, AlertType.ERROR); a.setTimeout(Alert.FOREVER); a.setCommandListener(this); display.setCurrent(a); } else { if (!stop) { ioe.printStackTrace(); } } } catch (Exce

文档评论(0)

1亿VIP精品文档

相关文档