|
Java ME - NetBeans

At the time being Eclipse is the most
popular high-end tool for developing Java ME applications, but feature-wise NetBeans is well in line with Eclipse and in cases even better. NetBeans has numerous
features to speed up and simplify MIDlet development. It can also be used for Java ME/CDC, Java SE and EE development, as well as for XML and HTML editing, and from 5.5 also C/C++ development.
The main unique feature for Java ME development is
Mobility Pack, that
offers CAD-like design of the user interface look-n-feel and flow, and code
generation from that design, via the Visual Mobile Designer (VMD). In 5.x you can work directly in
the generated Java code to add the application logic, which is a big improvement
from 4.x.
Note that for game development VMD is of less help. You can use it to create the flow for e.g. login and setup screens, and then also an empty canvas. After that it's up to you to
create all the visuals and logic for the canvas. Most games use their own UI on top of canvas for e.g. setup etc as well, so in
such cases you are not helped by VMD at all.
VMD generates standard MIDP lcdui calls, so the mobile phone won't notice a difference, and e.g. J2ME Polish can be used to customize the
VMD-created UI via Cascading Style Sheets. We've verified that the method calls generated by VMD work well with J2ME Polish.
NetBeans and Mobility Pack are free of charge, and
work together with
Java Wireless
Toolkit (WTK; included with Mobility Pack) to provide a complete development and emulation
environment for mobile applications. Most phone manufacturers also have their own development tools and emulators, that
typically are based on WTK with new skins and special configurations to match the feature sets of specific phones.
To get started you should download NetBeans, Mobility Pack and optionally the
Profiler. That's all you need. You may read Getting Started with Mobile Development for
the first steps needed to set up a Java ME / MIDP project in NetBeans. Then read
Quick Start Guide that goes through a simple application example using VMD. Another great resource is
Mobile Applications Learning Trail, that covers both CLDC and CDC development.
System Requirements
- NetBeans is a Java/J2SE application, and J2SE is in itself a
memory hog, so we recommend 1 GB or more to avoid constant disk swapping. Also close down applications you don't need, before using NetBeans.
- Apart from that it runs well on a 2+ GHz PC.
IDE Configuration
- Screen resolution: To get a better overview of a VMD flow, and also to see more of the source code, set the screen to the highest resolution possible. The scaled down screen shots
shown below are from a 21" CRT set to 1920 by 1440. 1024 by 768 is way too low for editing comfort.
- Fonts: Preferably use a proportional font (Verdana 10) and optionally also turn off all bold settings for all items. This makes reading the code much easier.
- Indentation: 4 spaces per indentation and insertion of spaces are recommended.
Screen Shots
Examples of NetBeans in action. This is in fact the UI of an early version of Jiminy! SMS.

Picture 1: each box represents a visible screen; lines
indicate flows between screens; to the top right are elements that
can be inserted

Picture 2: one of the screens being edited, in this case a form with different items like text fields and a choice group

Picture 3: the generated code; lines in blue are auto-generated and
can't be modified directly; on white lines application logic has been
added
See Resources for more information.
|