MIDP project structure

This phase describes the structure of a working environment for the project. On default settings, Nokia IDE for Java ME (Eclipse) and NetBeans use slightly different directory names, but divide the content in the same way as described below. This section deals with the issue based on a development environment that includes Nokia IDE for Java ME (Eclipse) and SDK for Nokia devices.

The following images show the folder structure in Nokia IDE for Java ME (Eclipse) and NetBeans.

Figure: Folder structure of HelloWorld imported to Nokia IDE for Java ME(eclipse)

Figure: Folder structure of HelloWorld imported to NetBeans

The content of the folders can be divided in several categories:

  • Source files

    The MIDlet source code is written in these plain text files using an IDE or a text editor. They are also known as Java files and use extension *.java. These are commonly located in the src folder and divided further into subfolders that are named after the package that contains the source file.

  • Compiled class files

    Java class files (*.class) are source files compiled into bytecode format so that they can be interpreted and executed by the Java Virtual Machine (JVM). During the compilation process these files are also preverified for mobile environment compatibility. Nokia IDE for Java ME (Eclipse) places Java class files in the bin folder and NetBeans places them in the build folder.

  • Resource files

    Resource files are optional media files that can include icons or image, audio, video and document files that need to be enclosed with the MIDlet and are required by the application. Resource files are located in the res folder. Series 40 platforms support most common media types such as MP3, WMA, MP4, JPEG, PNG, WAV, RM, and others. For a full list of supported formats on different mobile devices, see Mobile Multimedia on Nokia Developer.

  • Built packages

    After the build process has been completed successfully, the class files are collected in a JAR file that is used to distribute the MIDlet to mobile devices. These packages are placed in deployed folder when using Nokia IDE for Java ME (Eclipse) and dist folder when using NetBeans.

In addition to the above folders, the Nokia IDE for Java ME contains the following project specific files:

  • The .classpath file contains the paths to the input and output folders that are used by the compiler for the generation of the java classes. The input folders are the source (src) and resource (res) directories, while the output is saved in the bin folder.

  • The .mtj file contains configuration values (typically the version) for the APIs offered by each of the specified execution environments selected for the given Project.

  • The .project file contains the necessary pre-verification and build commands along with any arguments that need to be passed so that the application can be successfully pre-verified, built and packaged.

  • The Application Descriptor file contains all the Jad attributes specified for the project.

  • The build.properties file contains is a list of the source and resource files, along with the selected execution environments available for this project.