If, on the other hand, your application is strictly targeted for the mobile environment, then you
will have more freedom to take advantage of the Java ME features for mobile devices, such
as Bluetooth and GPS. Another interesting issue that arises with mobile development is the
constraint created by physical characteristics of the device, including input mode, screen size,
CPU, and memory. When targeting mobile environments, be aware of the limitations of the
mobile profile. Use some of the following points as guidelines:
F JME is not JS —do not expect the standard Java libraries to be available on the mobile
runtime. While some stripped down version of Java SE APIs are present in ME, others
do not exist at all. For instance, avoid using Swing components in your application;
instead, use the native JavaFX controls, and let the runtime module translate them to
their Java ME component counterparts.
F Screen relow —newer devices support screen orientation changes; you may have to
create GUI layouts that let your components automatically resize or reflow based on
the orientation of the screen. The layout of your controls should reflow gracefully to
handle portrait or landscape screen modes.
F Use vector graphics —try to use vector graphics where possible, as they are easily
portable between platforms and can resize with no degradation.
F Apply affects ahead of time —as of version 1.2 of the SDK , paint effects are not part
of the common profile; therefore, if you need paint in your effects, create a bitmapped
image with the paint effect already applied, then load the image.