Comparing Android and Java ME

Android takes a comprehensive, targeted and focused approach to building a mobile platform, and the usual JVM-based solutions are not enough for that. In Android, everything you need – the operating system, device drivers, kernel libraries, native Java interface, an optimized version of the Dalvik VM and the Java development environment – is in one package. The developer can be sure that when developing a new application all the main libraries will be on the mobile device.

This comprehensive approach differs from other solutions used in mobile programming, such as Java ME. Let’s take a brief look at Java ME, and compare the two approaches.

The standard version of the Java platform (Java SE) is suitable for personal computers and workstations. The enterprise version of the Java platform (Java ME) is designed for servers. The micro version of the Java platform (Java ME) is a shortened version designed for small devices. Java ME is available as two configuration options. The first option is called Connected Device Configuration (CDC). Java ME for CDC contains a simplified version of Java SE – with fewer packages, fewer classes in them, and even fewer methods and fields in those classes. For equipment and devices that have additional constraints, Java uses Connected Limited Device Configuration (CLDC).

The CLDC Java platform is based on a specialized and highly reduced version of the JVM called the K Virtual Machine (KVM), which is capable of running on devices with only 128Kbytes of memory. The CLDC under MIDP 2.0 (profile for a mobile device with information functions) can use additional application programming interfaces. Such interface contains a number of packages for javax. microedition. *. The basic packages include midlets (simple applications), a package for user interfaces called LCDUI, game and media packages.

The application programming interfaces for CDC configuration contain the java. awt API and the java.net API and some APIs for implementing security functions, in addition to those interfaces contained in CLDC. Additional profiles installed on top of the CDC give application developers access to the application programming interface javax. microedition. xlet (xlet is the application in the CDC configuration).

Let’s compare Java ME with Android:

  • Multi-device configuration options. Java ME distinguishes between two classes of microdevices, with standard and specific solutions for each. Android, on the other hand, uses only one model. It will not work with low-level devices unless their configuration is improved;
  • understandability. Because Android is device-specific, it is clearer than Java ME. Java ME uses several variations of user interfaces for each configuration, depending on what features the device supports: midlets, xlets, AWT, and Swing. JSRs for each Java ME specification are harder to track. They take longer to develop, and finding certain versions of them can be tricky;
  • responsiveness. The Dalvik VM is expected to be better optimized and responsive than a standard JVM used on a device with a similar configuration. Dalvik VM and KVM can be compared, but KVM is designed to work with less complex devices with much more modest amounts of memory;
  • Java compatibility. Since Android works with the Dalvik VM, it uses byte-code in DEX files rather than Java byte-code. This is not much of a problem if Java is compiled as standard Java class files. Only the direct interpretation of Java bytecode will not be possible;
  • breadth of implementation. Java ME is widely supported in mobile devices, since most cell phones are based on it. But Android is uniform, cheap and easy to develop programs – so Java developers may also be interested in writing programs for Android;
  • Java SE support. If we compare Java SE support in CDC and Android, Android has slightly more complete support, apart from AWT and Swing. As mentioned above, Android uses its own approach to working with user interfaces. In fact, Android’s declarative user interfaces resemble more advanced UI platforms such as Microsoft Silverlight and Sun’s JavaFX.

Thus, the comparative analysis suggests that Android is the preferred platform for application development.