您的位置:首页 >> 编程开发 >> Java >> J2ME >> 正文
RSS
 

[转]J2ME MIDP Device Fragmentation Tutorial with Marv The Miner

http://www.rdxx.com 04年12月03日 12:12 Blog 我要投稿

关键词: Tutorial , MIDP , J2ME , ATI , NT , CE , IT

j2me MIDP Device Fragmentation Tutorial with Marv The Miner

http://www.netbeans.org/kb/articles/tutorial-j2mefragmentation-40.html

Feedback

This tutorial shows how to configure the IDE to work with existing JavaTM 2, Micro Edition Platform (J2METM Platform) MIDP projects and, specifically, how to use the NetBeansTM IDE's built-in solution to the device fragmentation problem. Following this tutorial from start to finish will illustrate the following:

  • How to port an existing fragmented MIDP project to NetBeans
  • How to use the IDE's built-in device fragmentation solution

The example program this tutorial uses is the popular j2me game "Marv The Miner," which was released under GPL and written to run on several different mobile platforms.

This tutorial should take approximately two hours to complete and covers the following topics:

  • Import sources from an existing MIDP project.
  • Create and customize project configurations for each distribution Jar.
  • Mark pieces of source code as being specific to each configuration.
  • Build several distribution Jars for the project.
  • Use external emulators from within the IDE.

To follow this tutorial you need the MarvTheMiner_120_all.zip file, which contains the original source files of the program. Click here and download "Marv the Miner v1.2.0 (including level editor)" to obtain the source files.

  1. Setting Up Your Environment
    • Obtaining and Installing the Required Software
    • Starting the IDE
  2. Obtaining the Required Source Files
  3. Developing the Marv The Miner Application in NetBeans
    • Import Existing Sources
    • Creating Project Configurations
    • Customize Project Settings for Configurations
    • Create Custom Code Blocks for each Configuration
  4. Building and Executing the Marv the Miner Application
  5. Exploring Configurations Further
  6. Using Non-UEI compliant Emulator Platforms

Setting Up Your Environment

This section describes how to set up your system before starting the tutorial.

Obtaining and Installing the Required Software

The following software is required for the example:

  • The NetBeansTM Integrated Development Environment (IDE) with the NetBeans Mobility Pack 4.0 Beta 2 or FCS.
    You can obtain this software from the NetBeans download site: http://www.netbeans.org/downloads/index.html
  • JavaTM 2 Software Development Kit, Standard Edition (J2SETM SDK), v. 1.4.2 or higher
    You can obtain the J2SE SDK from http://java.sun.com/j2se/downloads.html
  • j2meTM Wireless Toolkit 2.0 or higher
    The j2me Wireless Toolkit is installed with the NetBeans Mobility Pack. You also can obtain the Wireless Toolkit from http://java.sun.com/products/j2mewtooklit/index.html.
  • Nokia Series 60 SDKs for Symbian OS
    The SDK can be obtained at http://www.forum.nokia.com/main/0,6566,034-483,00.html
  • SDK for one or more of the following: Nokia Series 40, Nokia Series 80, Nokia Series 90, Motorola SDK4.1 for j2me GA, Vodafone
    • You can obtain Motorola SDK4.1 for j2me GA from http://www.motocoder.com/motorola/pcsHome.jsp?node_name=SDK (registration required)
    • You can obtain Nokia SDKs from http://www.forum.nokia.com/main/1,6566,030,00.html. Select Java in the "View tools by technology area" drop down box.
    • The Vodafone SDK is available only to Global Partners, and can not be obtained via simple online registration.

Use the instructions provided at the download sites to install the software.

    Starting the IDE

    To start the NetBeans IDE:

      • On Microsoft Windows
        Choose Start > Programs > NetBeans version > NetBeans IDE.
      • On UNIX, or Linux environments
        In a terminal window, type sh IDE-install-path/bin/runide.sh

    The IDE-install-path variable stands for the path to the IDE's home directory.

    Obtaining the Required Source Files

    The MarvTheMiner_120_all.zip file contains the source files of the original Marv The Miner application. The zip includes a MarvTheMiner directory, which contains the src and res subdirectories that you will use in this tutorial.

    To unzip the MarvTheMiner_120_all.zip file:

    1. In your file system, create a temporary location for the contents of MarvTheMiner_120_all.zip.
      For example, this tutorial refers to this directory as the C:\temp directory.
    2. Use an application that unzips files to unzip the MarvTheMiner_120_all.zip file to the temp directory.
      The temp directory now has a MarvTheMiner directory, which contains the following files and subdirectories:
      File or Subdirectory
      Description
      src The source files which make up the Marv The Miner program.
      res Contains the resource files used by the program. This includes graphics as well as .map files which are used to define the game level's layouts.
      MarvEditor A level editor (outside the scope of this tutorial).
      Nokia.full A Nokia build of the game.
      MIDP.full A generic MIDP build of the game.

    3. Move the res directory to C:/temp/MarvTheMiner_120_all/src/. This is a small work-around to make sure the resource files maintain the correct relative path once we create a new NetBeans project.
    共5页  第1页 第2页 第3页 第4页 第5页

     
     
    标签: Tutorial , MIDP , J2ME , ATI , NT , CE , IT 打印本文
     
     
      热点搜索
     
     
     



    Valid XHTML 1.0 Transitional
    Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
    收藏本页
    收藏本站