A mixed bag

JavaOne 2015 Diary – Day 2

Lars Röwekamp
© Hazelcast

JavaOne is happening as we speak and we’ve got Lars Röwekamp reporting on what you want to know from the biggest Java event of the year. Day 2 of his daily digest has it all – IoT, Mobile, Embedded and of course plenty of Java.

Staying true to the motto of “Reduce to the Max”, my focus for today’s sessions will revolve around the themes of Java for IoT and Mobile. It was interesting to see the different approaches there are in the Java world for these two areas. Not surprisingly, Java ME Embedded continues to pop up and play a role.

iOS and Android apps with Java 8

Mobile applications for iOS and Android, programmed in our beloved Java 8? This doesn’t fit together somehow, especially if you want to set up a common code base for both operating systems. This was my way of thinking before I heard from Shay Shmeltzer, the Director of Product Management at Oracle, who presented a session about the Mobile Application Framework (MAF).

MAF is a full MVC framework for cross-platform app development in Java 8. The runtime, which is bundled with the app, allows direct debugging of Java code on the device – Oracle uses a special 64-bit Lightway JVM and Java 8 Compact2 profiles. The application itself is written in Java, JavaScript and HTML 5, and thanks to the integration of Apache Cordova, gives access to various device features and native APIs of the underlying mobile operating system. Oracle itself uses MAF for the development of several of their clients apps, says Shmeltzer. Good to know! “Eat your own dogfood” has always been a good way to improve on your own products.

SEE ALSO: JavaOne 2015 Diary – Day 1

For AMX views, Oracle has an XML-based, component-oriented solution, which includes declarative data binding. This is strongly reminiscent of JSF or FXML views. More than 80 pre-built UI components are there that can be customised via CSS “out-of-the-box”. MAF also includes special visual editors and an integration option in Eclipse via the “Oracle Enterprise Pack”.

Whoever thought of the glorious idea of using MAF as a warpper to get JavaFX applications onto iOS and Android devices (like myself) will unfortunately be disappointed. The two approaches are incompatible and Shmeltzer was vocal about different target groups.

“Does it cost anything?” The slightly cynical answer to this was “Of course it costs. It’s from Oracle.” But the price will probably depend greatly on the usage scenario of the app or existing Oracle licenses.

As a sidenote: There’s a project proposal from Oracle for porting OpenJDK Runtime 9 on leading mobile platforms. Should this project actually materialise, it could be combined with JavaFXPort in an elegant way in the future to make JavaFX applications available across platforms and with little effort. See here to make some sense (or nonsense) of this proposal.

Microservices for IoT in Action

Microservices and IoT where once a contradiction of terms. IoT devices bring with them restrictions under certain circumstances, some of which happen to be an essential aspect of Microservice-oriented systems: Continuous Integration and Deployment. Very limited resources or connectivity are just two examples here. I learned today how to deal with this challenge from Marcel Hoffmann, who hails from Luminis Technologies.

During a demo of a modular entertainment system (music, weather info, navigation, phone, etc), which could be run on a smart phone or a car infotainment system, we were shown Hoffmann’s practical solutions for development, integration, deployment and monitoring of various modules.

The individual modules were realised as OSGi bundles where RESTful Microservices in Java were using the open source platform Amdatu deployed in the cloud. Hoffmann used the Eclipse plug-in Bndtools to simplify OSGi-based development.

To have access to the individual entertainment system modules at runtime and to be able to update these problems if necessary, Hoffmann demonstrated use of the Software Distribution Framework Apache ACE.

All in all, this was a really interesting tool stack to allow the development and (continuous) deployment of OSGi-based Microservices in the cloud. It looked almost easy.

Small, smaller, smallest (a.k.a. Java ME Embedded)

Java ME was still surprising me with its presence today! And thanks to the rapidly growing number of sometimes quite inefficient IoT devices, it seems to be experiencing a true renaissance. The intended target devices for Java ME Embedded are no longer the good ol’ mobile or cell phone. Instead, emphasis is more concentrated on sleep trackers, fitness bracelets, smart meters or networked sensors in cars. This is a super exciting environment with enormous potential for the future. This was reason enough for me to attend the session “Smart Devices for IoT: Java ME Embedded 8.2. and beyond ” by Terrence Barr (Senior Technologist, Oracle) to bring us up to date with the current state of affairs.

When I mentioned underperforming IoT devices, I didn’t mean something like the Raspberry Pi or other similar, popular devices. These devices could be considered supercomputers in the world of Java ME Embedded. What I’m getting at are devices with a few 100 kbytes of RAM.

SEE ALSO: JavaOne 2015 Diary – Day 0

Simplistically speaking, we’re dealing with Java ME Embedded 8.2 – a stripped down version of Java SE 8. Language features such as generics, etc. are almost available 1 for 1 (there are exceptions in individual APIs, of course). Thus one finds, for example, no APIs or very rudimentary ones in the visual design of user interfaces. These are in embedded devices, where the data exchange happens usually amongst themselves, or with a server and doesn’t require a UI. To address this, Java ME Embedded are launching tools to assist in the remote installation and remote management of applications.

In an “In-Vehicle IoT Services” demo, Barr also demonstrated a real example of how Java ME embedded applications can be deployed and managed on a variety of boards via OTA (over-the-air). The various installed services collected runtime data, such as whether a board had been moved, and sent this data automatically for analysis to a built-in server. Next, runtime environments with significantly less powerful boards came into the demo besides a Raspberry Pi: the Freescale K64 Freedom and STM32429I-EVAL. What’s really interesting is that the exact same Java ME application was used on all boards. If “Write once, run anywhere” in the embedded environment could actually become reality, it would be too good to be true.

According to Barr, the next release of Java ME Embedded is scheduled for Q2 2016. With the new version we should see how far a Java application can be updated Over-the-Air, as well as the entire Java runtime. If you consider that we’re talking about a mass-market need to partially update several hundred thousand devices, this seems to be the real icing on the cake. Furthermore, support for Bluetooth LE will be integrated, which is also an important step. More and more embedded devices support this standard so that simplified connectivity can be made possible.

Summary

So what are my conclusions after today? From my perspective, the train for Java on your phone or tablet has long since departed. Even if the proposed Oracle project to port the OpenJDK Runtime 9 is implemented for iOS, Android and Windows Mobile, the resulting applications will not be comparable to native apps. Java would just be another cross-platform solution among many. Granted, it would be a solution with a very large community. But do people want the same applications on different platforms such as Android and iOS? As an Android user, I don’t care whether the application looks the same on my colleague’s iPhone or not. What’s much more important is that they are on my device as expected, just the way native apps behave.

What’s way more interesting to me is the resurrection of Java ME (Embedded). Currently, the programming of most embedded devices is extremely complicated because of proprietary programming languages ​​and APIs. Java can bring some genuine simplification into this field. This is especially true in light of its expected growth and the need for developers in this area.

Thanks to current discussions, topics such as Microservices and the once-declared dead IoT seem to be in vogue again. A good example is OSGi. Why is that? However you look at it, this is what always happens with highly distributed systems and their related problems. The environment or theme isn’t exactly new and there have only been bad solutions presented in the last 20 years.

I’ll hopefully be attending some interesting sessions tomorrow, so stay tuned! For now it’ll be nice to meet a few old friends, drink a beer or two and network the night away. The evening program at JavaOne is just as interesting and informative as the sessions during the day!

Author

Lars Röwekamp

Lars Röwekamp is the CEO of Open Knowledge GmbH and has been advising customers on international projects for more than ten years around the theme of enterprise computing. You can find him on Twitter at @mobileLarson.


Comments
comments powered by Disqus