Posted by editor
on October 27, 2008 at 7:52 AM PDT
Controlling stuff (or not) with Java... also:
Forum Posts: Using peripherals with Java, LWUIT media and menu components, getting a device id, and using JNA instead of JNI
Java Today: White Lassi project, WS-JMX connector, and updated Java Application Platform SDK overview
Spotlight: Open nominations for JCP election
Weblogs: Java deployment, embedding a screencast recorder in your app, and Rails and Grails support in GFv3P
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
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."
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."
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