Designing and Coding
Designing and Coding Before you can begin an actual development cycle, you must first create the directory structure that will support the development of your MIDlet suite. A MIDlet suite is a collection of MIDlets that share common application resources. You'll learn further details about these shared MIDlet resources in later chapters of this book. I first create a directory called HelloWorld, which is the name of our first example application, under the apps/ directory of the wireless toolkit installation. This directory is the root of your new project. A project is an organized aggregation of resources—source code, resource files, compiled files—specific to one or more related applications. The project root directory contains the subdirectories shown in the following sample code: $ pwd /cygdrive/c/J2mewtk/apps/HelloWorld $ ls -F bin/ classes/ res/ src/ tmpclasses/ There is a reason for using this precise directory structure, which I will explain later when you learn how to use the Wireless Toolkit Emulator. However, even if you don't plan to use the J2ME Wireless Toolkit, this organizational structure is a reasonable one to start with. Table 2.1 explains the contents and purpose of these directories. I won't discuss actual application design here, because that topic is beyond the scope of this chapter. The goal here is not to discuss how to design Java applications or even MIDP applications. Subsequent chapters, however, will talk about organization of MIDP applications. 15 Table 2.1. Subdirectories of Projects Created by the J2ME Wireless Toolkit Subdirectory Name Directory Contents bin Application files: .jar file, .jad file, MANIFEST.MF classes Compiled and preverified .class files res Application resource files, such as .png formatted image files in PNG format src Application source files tmpclasses Compiled, unverified .class files
730 times read
|
|
|
|