Wednesday Sep 25, 2013

Session Report: Is It a Car? Is It a Computer? No, It’s a Raspberry Pi JavaFX Informatics System

by Timothy Beneke

On Tuesday, Oracle Technology Evangelist Simon Ritter presented a session that demonstrated how a simple Raspberry Pi computer could be connected to an Audi to access far more information about the inner workings of the Audi than is currently available. Ritter, a great showman who has entertained thousands of JavaOne attendees over the years with his Java tricks, communicated his contagious passion for gadgets – and for sharing them with others.


“I love computers and all things electronic, and I also love cars – I’m a petrolhead -- so I’ve combined these 2 passions into one thing,” said Ritter. 

His talk was divided into several sections. He began by talking about the reliance of cars upon computers and moved to a discussion of the Raspberry Pi and why it’s a good choice for the kinds of systems he built into his car. He went on to briefly provide some background about embedded Java and JavaFX, and why they are good choices for the Raspberry Pi. He then spent much of the session describing the software system he built in his car, its functionality, how it works, and so on. He speculated on possible future enhancements to his “carputer,” and, finally, showed a video that provided a sense of what it is like to ride in the car with the new data accessible.

He initially made the point that computers and cars are now inexorably tied together. His first car, a 1971 Mini Clubman 1000 had, aside from a radio, no electronics. In contrast, his most recent car, a 2011 Audi S3, has lots of electronic devices, like all modern cars: an engine control unit, fuel injection/electronic timing, “Fly-by-wire” throttle, an anti-lock braking system, Satellite navigation, auto-sensing wipers and lights, and much more, some of which are mandated by law. The key point is that cars are already heavily computerized.

He described how the bus architecture works in the Audi, a communication system that transfers data between components inside a computer, and presented basic information about embedded Java, Java ME and JavaFX.

The Advantages of the Raspberry Pi for Car Computing
Ritter described the history of the remarkable Raspberry Pi, a project begun in 2006 that was initially created to inspire children to learn about computers. It was officially launched on Feb 29th, 2012 and currently, nearly 2 million have been shipped at a cost of around $25. It is ideal for children because of its cost and ease of use.

Its core features are:

* CPU: ARM 11 (v6) core running at 700MHz
– Broadcom SoC package
– Can now be overclocked to 1GHz (without breaking the warranty!)
* Memory: 512Mb
* I/O:
– HDMI and composite video
– Audio out (3.5mm plug)
– 2 x USB ports
– Ethernet
– Header pins for GPIO, UART, SPI and I2C

Ritter pointed out that adult computer geeks have been playing with the Raspberry Pi in countless ways. He then summarized why it is ideal for car computing:
* It has plenty of computing power with low electrical power consumption (< 1 Amp at 5V).
* Persistent storage is provided by the SD card.
– Disk drives are not ideal in hot places with lots of vibration.
– It’s a supported device for embedded Java.
– It is configured for floating point acceleration.
– It works with Java SE Embedded and Java ME Embedded.
                  --   A JavaFX Prism graphics engine is ported.

His goal was to gain new information from his car in real-time and have it available for analysis to ultimately improve his driving style:
* Display realtime data
– Engine performance (Power, Torque, Load)
– Driver data (Throttle position, steering angle, braking force, etc)
– G-Forces on car
* Record data for later analysis
– Produce graphs to display changes over time
– Play at Formula 1
– Improve driving style

He went on to describe the creation of the accelerometer, touch screen, measures of torque, among other things, and closed with a 3-minute video showing the box in action in the car from the perspective of someone riding in the car with various measures visible. Then he played back the information recorded on the drive.

All in all, a super entertaining, informative session.

Ritter will be posting more info about his session here: blogs.oracle.com/speakjava

Audi
The Raspberry Pi
Check out Parleys.com where you can listen to the session in early October.

Tuesday May 15, 2012

JSF 2.0 for the Cloud, Part Two

Part Two of Deepak Vohra’s “JSF 2.0 for the Cloud” is now up on otn/java. In Part One, Vohra demonstrated how to take advantage of resource handling, @ManagedBean annotation, and implicit navigation. In Part Two, he explores new features in JSF 2.0 that make it ready for the cloud, including Ajax support, view parameters, preemptive navigation, event handling, and bookmarkable URLs.

Ajax support for JSF 2.0 components includes asynchronous transfer of data between a client and a server, along with partial page rendering, partial page processing, and grouping of components, and can be added using either f:ajax tag or the JSF Ajax library (jsf.js).

Regarding view parameters, Vohra explains, “JSF 2.0 added support for view parameters, which add the provision to send request parameters in a GET request. A view parameter is a UI component represented with the UIViewParameter class. Just like other UI components, it is saved in the UI component tree for a Facelets page and can be associated with validators and converters. A view parameter is an EditableValueHolder because it implements the interface.”

Preemptive navigation allows developers to determine the resource file that they  navigate to and request parameters, if needed, based on the navigation case and view parameters, thus allowing them to create a URL for JSF resources that they access from a GET request. As a result, the URL displayed shows the resource and all request parameters.

Developers should take note that plans are in the works to update Java EE 7 for “cloud-related practical considerations, such as multitenancy and elasticity, also known as horizontal scaling.” This will be available through JSR 342, which is scheduled to complete an early draft review on May 23, 2012. Specification leads are Oracle’s Bill Shannon and Linda DeMichiel.
Access the article here.

Thursday Apr 12, 2012

JavaServer Faces 2.0 for the Cloud

A new article now up on otn/java by Deepak Vohra titled “JSF 2.0 for the Cloud, Part One,” shows how JavaServer Faces 2.0 provides features ideally suited for the virtualized computing resources of the cloud. The article focuses on @ManagedBean annotation, implicit navigation, and resource handling. Vohra illustrates how the container-based model found in Java EE 7, which allows portable applications to target single machines as well as large clusters, is well suited to the cloud architecture.

From the article--

“Cloud services might not have been a factor when JavaServer Faces 2.0 (JSF 2.0) was developed, but JSF 2.0 provides features ideally suited for the cloud, for example:
•    The path-based resource handling in JSF 2.0 makes handling virtualized resources much easier and provides scalability with composite components.
•    REST-style GET requests and bookmarkable URLs in JSF 2.0 support the cloud architecture. Representational State Transfer (REST) software architecture is based on transferring the representation of resources identified by URIs. A RESTful resource or service is made available as a URI path. Resources can be accessed in various formats, such as XML, HTML, plain text, PDF, JPEG, and JSON, among others. REST offers the advantages of being simple, lightweight, and fast.
•    Ajax support in JSF 2.0 is integrable with Software as a Service (SaaS) by providing interactive browser-based Web applications.”
In Part Two of the series, Vohra will examine features such as Ajax support, view parameters, preemptive navigation, event handling, and bookmarkable URLs.

Have a look at the article here.

About

Insider News from the Java Team at Oracle!

duke
javeone logo
Links


Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
2
5
6
7
12
13
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today