Java ME 8 and the Internet of Things

by Steve Meloan and Terrence Barr

Top features of Java ME 8

A major theme of the 2014 Consumer Electronics Show in Las Vegas, Nevada, was wearable computing. Under the hood of such diverse hardware devices as sleep-monitoring infant clothes, sports-enhancing wristbands, and pet accelerometer collars, as well as mainstay technologies such as connected vehicles, smart appliances, medical sensors, smart meters, and industrial controllers, lies a broad array of embedded and connected computations devices—increasingly termed the Internet of Things. By many estimates, this decade will see billions of such connected things, spanning a broad range of hardware and memory specifications.

But every good story begins with a challenge of some kind. For all the promise and possibility of the exploding space of embedded devices, there are also a number of obstacles. The ubiquity and pervasiveness of such technologies, along with the growing fragmentation of hardware architectures, devices, system software, and infrastructure, cries out for unified development standards in terms of programming language, software platform, tools, testing, deployment, scalability, and developer community. The hardware and software fragmentation of the current embedded space often requires piecing together the entire development stack for a given hardware platform—including the runtime, the tools, the languages, the APIs, the protocols, and the connectivity.

Originally published in the March/April 2014 issue of Java Magazine. Subscribe today.

Java ME 8 provides a purpose-built, scalable, and flexible development and deployment environment for the embedded space, including language, standards, platform, tools, security, scalability, and a 9-million-plus community of Java developers already versed in the overall language and platform—all poised to help facilitate what many predict will be a third IT revolution. Figure 1 shows an overview of the Java ME 8 platform. The following sections explore the top new features of Java ME 8.

barr-f1

Figure 1

Connected Limited Device Configuration 8

Connected Limited Device Configuration 8 (CLDC 8)—the configuration underpinnings of Java ME 8—is an extended, strict subset of Java SE 8 that provides an evolutionary update to CLDC 1.1.1 while bringing the virtual machine (VM), Java language, and core API libraries into alignment with Java SE 8. CLDC 8 aligns the two platforms in terms of tools and programming model, while providing many new features specifically targeting the embedded space, as well as ensuring backward binary compatibility. CLDC 8 also provides such new Java language features as assertions, generics, annotations, and more. Java ME 8 is the first major step in the convergence of Java SE and Java ME, with further alignment planned for future releases.

Java developers can now more easily take their existing skills and begin writing applications for the exploding realm of embedded devices—using the same familiar platform, language, programming model, and tools. In so doing, they achieve a much faster time to market as well as cross-platform compatibility and embedded device scalability. Being mindful of appropriate language and API subsets, it’s possible to create an application or library that will run unmodified across a range of hardware, from very small CLDC 8 devices up to larger Java SE 8 type devices.

Generic Connection Framework 8

In the desktop or server world, one typically finds a simple and stable Ethernet pipe into the application or system. But the embedded space often presents highly varied connection options and needs—cellular, Wi-Fi, and wired (and often multiple connectivity options in a single device)—in order to achieve the required flexibility for a specific use case.

The Generic Connection Framework 8 (GCF 8) AccessPoint API provides fine-grained and optimized connectivity control—depending upon use case, available connection options, roaming specifications and costs, and data transfer needs.

And in a predicted era of billions of connected embedded devices, the ability to locate and intercommunicate via IP address is essential. GCF 8 provides full IPv6 support to tackle the long-anticipated issue of IPv4 address exhaustion. There is also support for IP multicast—not only for installing a device into the network and detecting and connecting to peers, but also the ability to act as a server while using fully encrypted Secure Server Socket connections.

Because security is important in today’s wirelessly connected world, and will be even more so with millions or billions of devices in a connected Internet of Things, GCF 8 also provides the latest security standards—including Transport Layer Security (TLS) 1.2 and secure datagram connections via Datagram Transport Layer Security (DTLS) 1.2—offering the highest levels of networked encryption and authentication.

Micro Edition Embedded Profile 8

While CLDC 8 provides the basic Java platform—in terms of the core runtime, core language features, and core APIs—it does not fully define the embedded application platform. Micro Edition Embedded Profile 8 (MEEP 8) sits on top of CLDC 8 and provides the application model and container, a means to provision applications to a system, to share code among applications, and to update software components during the lifetime of the system, for example, to add new functionality or to deploy updates and bug fixes.

MEEP 8 also provides for partitioning and modularizing the individual functional components of an application—an interface to a sensor, data filtering logic, connection to a server, and so on. In this way, processing granularity is established at the service level rather than at the application level, making provisioning, management, and updating of the embedded application much simpler and more elegant.

Meanwhile, right sizing via profile sets provides highly specific customization of memory footprint for given application use cases. A particular application might not need or use a given set of functionality. Selecting the appropriate profile set can, thereby, eliminate unnecessary functionality and memory uses. If a later use case expands functionality, additional optional packages (technology-specific APIs) can be added—offering seamless scaling.

Pertinent to both minimizing memory footprint and modularizing application functionality, MEEP 8 also provides shared libraries (LIBlets)—where multiple applications can share common library code. Read-only code thus resides in one shared place in memory, rather than within each individual application space. As an added bonus, such shared library space can be updated or altered just one time for all applications accessing it.

EMBEDDED-READY With a stable of 9-million-plus Java developers already in the field, the Java ME 8 release offers not only vast new career possibilities, but provides an industry-growth catalyst for the entire burgeoning embedded space.

Meanwhile, so that applications running on embedded devices can maximally collaborate and communicate, MEEP 8 offers both asynchronous event-based messaging (akin to a publish-subscribe mechanism) and synchronous Inter-MIDlet Communication (IMC; akin to a UNIX pipe).

MEEP 8 also provides a sophisticated and fine-grained security model, enabling use case–specific security policies for authentication and authorization (see Figure 2). Sandboxed execution ensures secure code loading, verification, datatyping, and configurable permission controls for access to resources and data. Individual software components are associated with specific clients and inherit their allowed privileges. And such permissions are confirmed at every access event.

barr-f2

Figure 2

Device Access API

The Device Access API for Java ME 8, already present in previous Java ME releases, is critical functionality that enables embedded Java applications to access peripheral devices such as buttons, switches, sensors, LEDs, LCD screens, audio, and more in a platform-neutral way. It now expands access to more devices and adds new functionality. And late binding functionality allows for the addition of new peripheral types without changing the API.

Java ME SDK 8

Java ME SDK 8 offers a full-featured and purpose-built toolset for embedded development, including emulation and simulation environments for a variety of devices—so applications can be developed in parallel with hardware, thereby vastly improving time to market. Developers can simulate, test, and debug in emulation mode, and then once the actual hardware devices and peripherals are in place, have much greater confidence in the final testing of applications.

In addition to security, memory, and network monitoring tools, the Developer Agent in Java ME SDK 8 provides levels of access and control beyond those of typical embedded development environments, including the ability to reset devices, access file systems (on screenless devices), make configuration changes, and more—all from Java ME SDK 8. Meanwhile, NetBeans plug-ins offer full-featured, IDE integration with the Java ME SDK—providing a familiar and unified development environment across Java ME, Java SE, and Java EE, with support for Eclipse becoming available alongside the Eclipse support timeline for Java SE 8, Java ME 8, and Java ME SDK 8.

Conclusion

Earlier eras of the cell phone space saw fragmented hardware that was, in many ways, similar to today’s embedded technology space. Part of what ultimately helped spawn the explosive growth of smartphones and mobile apps was the establishment of standard development platforms, languages, and tools.

Java ME 8 now offers just such a comprehensive, purpose-built platform for connected embedded devices and the Internet of Things. And with a stable of 9-million-plus Java developers already in the field, the release offers not only vast new career possibilities, but provides an industry-growth catalyst for the entire burgeoning embedded space.

The Oracle Java ME Embedded 8 and Oracle Java ME SDK 8 Early Access releases are available at no cost for evaluation and development purposes under the Oracle Technology Network Developer License.

Steve Meloan is a former C/UNIX software developer who has covered the web and the internet for such publications as Wired, Rolling Stone, Playboy, SF Weekly, and the San Francisco Examiner.

Terrence Barr is a senior technologist and product manager at Oracle who focuses on the Internet of Things and embedded technologies.