1、基于 J2ME 的手机游戏开发 摘要 :随着 通信技术的发展和手机的普及 ,手机游戏 的 开发 技术 越来越 为人们所关注。 以J2ME 为开发平台,利用 Java 提供强大工具,不但可以在手机上实现静态 HTML 技术所无法实现的计算处理、数据存储、与服务器的通信等功能,而且能够开发各种手机游戏 。本文在介绍 J2ME 及其体系结构的基础上, 以贪吃蛇游戏为实例,描述 了借助 J2ME 的 MIDlet类库 开发 手机游戏 的过程 。 关键词: 手机游戏 ; MIDP 应用程序 ; 永久性数据 Develops based on the J2ME handset game Abstract:
2、 Along with communication development and handset popularization, people more and more pay attention to the handset game development technology. Develops the platform take J2ME, provides the powerful tool using Java, not only may realize the handset functions that static HTML technology be unable to
3、 realize, such as computation processing, data storage, and communication with server, but also can develop all kinds of handset games. On the basis of the technology and architecture of J2ME being introduced, the gluttonous snake game was taken as a example, the development process of handset game
4、with the aid of the J2ME MIDlet class library is described in this article. Key Words: Handset game; MIDP application pragram; Permanent data目 录 第一章 绪论 . 1 1.1 研究背景 . 1 1.2 研究内容 . 1 第二章 J2ME 及其体系结构概述 . 2 2.1 J2ME 简介 . 2 2.2 J2ME 体系结构 . 2 2.3 移动信息设备简表概述 . 3 2.3.1 MIDP 的目标硬件环境 . 3 2.3.2 MIDP 应用程序 . 3
5、2.3.3 CLDC 和 MIDP 库中的类 . 3 2.4 J2ME API 简介 . 4 2.4.1 MIDP API 概述 . 4 2.4.2 MIDlet 应用程序 . 4 2.4.3 使用定时器 . 5 2.4.4 网络 . 6 2.4.5 使用 Connector . 7 2.4.6 使用 HttpConnection . 8 2.4.7 永久性数据( RMS) . 9 2.4.8 存储集( Record Store) . 10 2.4.9 记录 . 11 2.4.10 枚举 . 12 2.4.11 异常 . 13 2.5 用户界面( LCDUI . 13 2.5.1 UI 基础 . 13 2.5.2 高级 UI . 14 2.5.3 低级 UI . 15 第三章 手机游戏开发过程 . 16 3.1 贪吃蛇游戏的规则简介以及开发环境 . 16 3.1.1 贪吃蛇游戏的规则简介 . 16 3.1.2 开发环境 . 16 3.2 详细设计 . 16 3.2.1 代码设计 . 17 第四章 程序的调试与运行 . 22 4.1 游戏的调试 . 22 4.2 游戏的运行环境 . 23 第五章 总结 . 24 致 谢 . 25 参考文献 . 25