Skip to main content

Box

Posted by editor on October 27, 2008 at 7:52 AM PDT


Controlling stuff (or not) with Java

Has the coolness of web programming trumped the appeal of interfacing with physical devices? When a lot of us were young, the most fascinating kind of programming was hooking up sensors or motors to an Apple II's paddle control and writing programs that actually interacted with the real world.

This kind of thing seems to be rare in Java. It does exist, as proven by the SunSPOT and the Java-powered TrckBot, but while the Java platform offers more APIs than you can count for working the virtual world of the web, there doesn't seem to be anything in Core Java that can expose your application to the real world.

In the forums, jasonbe asked about programming peripherals in Java, and the first response was "don't use Java". In the follow-up, Re: Learning to program with peripherals jasonbe writes:

Java is what they are teaching in school at my level - and what I have to learn. So, if by a chance that is odd or favorable, anyone knows of any example public domain program code - for peripherals with potentiometers and/or buttons, that I can search through to try and find variables that were declared and defined by the peripheral, this would still be helpful. The simpler the code, the better. Based on your response, I don't expect anyone to point these variables out to me. However, this would be helpful. And someone at school might be able to point these variables out if the code was provided. I was thinking that this post might belong under Global Education and Learning because it address the needs of students with different learning styles.

Someone with a better idea of how to interface to arbitrary peripherals -- those not abstracted away by Java as "mass storage" or "input device" or something else -- might want to describe just what's out there and how you'd access it from Java, if you even can. There are thousands, if not millions, of crazy USB devices that could be fascinating to interact with, but the Java USB API remains non-Core and very spottily implemented.

High-school age programmers probably don't want to write financial applications or transactional databases... but they might be interested in making devices see, hear, spin, roll, lift, and/or just blow up. Can they use Java for that? Should they?


Also in today's Forums, Chen Fishbein discusses how to handle media and overlaid menus in LWUIT in
Re: Menu Got Obscured by MediaComponent. "Media is usually painted in a different layer(in most cases in native), therefore when you use the MediaComponent you should be aware of that. You have 2 options: 1)don't use a Menu when you show a MediaComponentm 2)make the Video not visible when the Menu is popped up."

alxxx asks
how to get device iD? "how can i get the device id with j2me(midp 2.0)? If it's impossible,then please tell me if there is another way to find something different for all mobile phones."

rexguo revives a long-dormant thread about JNI's difficulties, Re: JNI Improvements, by offering an alternative. "Try JNA: JNA provides Java programs easy access to native shared libraries (DLLs on Windows) without writing anything but Java code—no JNI or native code is required. This functionality is comparable to Windows' Platform/Invoke and Python's ctypes. Access is dynamic at runtime without code generation. It is pure Java access to native libraries. https://jna.dev.java.net/"


In Java Today,
the White Lassi project hopes to "address the ever growing telecom industry trends." Noting that "there is a need for creating rich, collaborative and intuitive application services that can leverage upon the promises of 4G, [...], the service delivery framework should be standardized..to allow seamless integration with 3rd party services. The white lassi project aims to do just that. Application services of whitelassi will be built upon the JSR-240 JSLEE standard implementation" The project owner is also blogging about the project's progress.

Jean-Francois Denise has announced the release of Early Access 4 of the Web Services Connector for JMX. "You can download it from ws-jmx-connector.dev.java.net. The changes since the early access 3 are detailed in the release notes. The major improvement is related to the JMX-to-XML mapping of CompositeData and TabularData. We have defined a much more compact representation that makes exchanged messages up to 3 times smaller."

An updated SDN article, Java Application Platform SDK: Overview, offers an overview of the comprehensive bundle for learning, developing with, and deploying Enterprise Java technologies. "This article discusses the key features of the Java Application Platform SDK Update 6. With this all-in-one bundle, developers can quickly learn, develop, and deploy new enterprise Java technologies. More than 5.5 million developers have downloaded earlier versions of the Java EE SDK."


This week's Spotlight is on the Open Nominations phase of the 2008 JCP elections, which is now underway. There is one seat on the SE/EE Executive Committee and two seats on the ME EC up for this year's election. All Java Community Process Members who have signed the JSPA 2 are eligible to nominate themselves. Self nominations will be open from October 21, 2008 through October 31, 2008. Then, from November 4, 2008 - November 17, 2008, members will be asked to vote for their top choices for each EC.


In today's Weblogs, David Herron asks
Is there a standard way to deploy a Java application? "Outside the obvious statement of it would be nice for Java to be there in the operating system so it can be an assumed part of the infrastructure (thanks to OpenJDK we're moving in that direction for free OS's) this thought that there is a 'standard' way to deploy a Java app strikes me as being a little odd."

Fabrizio Giudici shows off Creating an embedded screencast recorder in your desktop application. "I still wonder whether I've actually understood what's happening, and I realize that a log file is not enough. I'd really like to see a screencast of the thing. [...] I thought that it would be cool to create a plugin that can be integrated in my application and do the recording by itself."

In What's keeping me busy?, Vivek Pandey writes, "It has been a while since I did any blog. So, I will start with letting you know what I have been up to and what's keeping me busy these days.... I have been working on making Rails and Grails support in GlassFish v3 Prelude, which is complete and soon we will have GlassFish v3 Prelude released."


Current and upcoming Java
Events
:

Registered users can submit event listings for the href="http://www.java.net/events">java.net Events Page using our href="http://today.java.net/cs/user/create/e">events submission form.
All submissions go through an editorial review before being posted to the
site.


Archives and Subscriptions: This blog is delivered weekdays as
the Java
Today RSS feed
. Also, once this page is no longer featured as the
front page of java.net it will be
archived along with other past issues in the href="http://today.java.net/today/archive/">java.net Archive.

Controlling stuff (or not) with Java

Comments

There are a couple of options which may fit the bill. Firstly, http://www.phidgets.com/ sell starter kits of RFID readers, sensors, actuators etc which are controllable via USB. They provide bindings for Java, .NET and Python. Alternatively if that is too expensive for the school and jasonbe doesn't mind building his own electronics, the Arduino project http://www.arduino.cc/ sells a micro-controller board called the Diecimilia which is programmable with the Processing Development Environment http://processing.org/ which is based on Java.