Tuesday, May 10, 2016

Java, mon amour (again on Edison)

Yes, it is true that Java is rather old. But it is also a wonderful language.

When I started working in Java, coming from C++, it seemed to me a breeze. No problems with memory allocation, no problem with pointers. Difficult to make big mistakes. Elegant and simple.

Then, year after year, with many improvements a lot of packages and functionalities have been added.

No more simple.

It is a long and complicated discussion. Probably Java is old.

But it is really nice for me to write code in Java (well, I don’t write code as an everyday job, as it was 20 years ago, so I’m not so fast) but… it is nice.

I have discovered that it is really easy to write a program for Intel Edison, in Java, using UPM libraries to read sensors and using MQTT to communicate with an MQTT broker.

Here, in one of my github repository, you find the Java code. It took only some hours.

https://github.com/luigisaetta/edison/tree/master/src/edison

Will it work?

Yes, sure.

I’ll describe the pieces of the code in another blog post. But do I really need?

update… here is the proof that it works. The client is the Paho GUI client.

NewImage

No comments:

Post a Comment