Saturday, May 7, 2011
Terrences Cool Meet Me For Dinner Demo
Terrence has just released the sources for his cool "Meet Me For Dinner" JavaOne demo. The demo shows off some pretty cool effects and social web/location interaction.
Check out his post for more information.
Wednesday, May 4, 2011
Play It Again LWUIT
The next version of LWUIT will completely replace the way to interact with media and supersede it with our own API's. When we initially introduced LWUIT's MediaComponent, MIDP was the major target for LWUIT and blackberry support was on top of MIDP.
Since then we had Thorsten porting LWUIT to RIM/Android and introduced ports to TV, Java SE etc. MMAPI isn't available on all of those platforms.
This called for a rethinking of our approach to media and so we introduced VideoComponent which uses the peer component architecture to embed a video into LWUIT. Unlike the older MediaComponent code there is no need for MMAPI know how or any information on the underlying playback. Just use a URL or stream+mime type to playback any video file.
Audio is integrated even deeper right into the Display class with methods to create an audio stream and play it. The main feature here is automatic resource cleanup which is a frequent problem with audio files (neglecting to close an audio resource properly is a big portability issue). LWUIT automatically closes resources as necessary in a way that is completely seamless for the developer, again with no need to know anything about MMAPI or the platform native implementation.
Since then we had Thorsten porting LWUIT to RIM/Android and introduced ports to TV, Java SE etc. MMAPI isn't available on all of those platforms.
This called for a rethinking of our approach to media and so we introduced VideoComponent which uses the peer component architecture to embed a video into LWUIT. Unlike the older MediaComponent code there is no need for MMAPI know how or any information on the underlying playback. Just use a URL or stream+mime type to playback any video file.
Audio is integrated even deeper right into the Display class with methods to create an audio stream and play it. The main feature here is automatic resource cleanup which is a frequent problem with audio files (neglecting to close an audio resource properly is a big portability issue). LWUIT automatically closes resources as necessary in a way that is completely seamless for the developer, again with no need to know anything about MMAPI or the platform native implementation.
Tuesday, April 26, 2011
Generating A Netbeans Project From The Resource Editor
I already had a similar tutorial in the past but this one is more refined and concise (thanks to http://www.screencast-o-matic.com/). This is a simple developer oriented tutorial showing how simple it is to create a hello world application directly to Netbeans and reviewing the output you get as a result.
Wednesday, April 20, 2011
Mini Tutorial On Editing a Theme Attribute
Theme attributes and UIID's are some of the more challenging aspects of creating a theme. In this tutorial we try to break down the elements that can be customized for every component within the theme dialog.
Tuesday, April 19, 2011
Wednesday, April 13, 2011
Contain That List - Bringing Containers & List's Together
LWUIT's List's are a unique component in their adherence to the Swing concepts of MVC (model, view/controler, renderer). The difference between lists and container/component hierarchy can be summed up quite easily: "Lists are about showing data, containers are about showing widgets".
Widgets can be anything, tend to be interactive and have elaborate hierarchies.
Data can be presented in many ways and might come in very large volumes.
This is easy to illustrate with the features of list, e.g. a list can be horizontal or fixed in various ways (as you would do to data) but its very hard to implement something like that with the container/component model.
Naturally each approach has its use cases and advantages and sometimes its really hard to shoehorn one approach to the other but we are sometimes forced to do so due to design aesthetic e.g. variable sized list.
Allot of people had an issue with implementing our recommended approach since they wanted to share code that used the list model/renderer approach with code that used layout managers. While this was technically possible its not trivial and is a common enough use case to fold it into LWUIT which is exactly what we did.
ContainerList is effectively a container that tries to abide by the contract of the list component, it creates thin internal components that render themselves using the cell renderer. To achieve this we had to replace the ListCellRenderer (which is now deprecated but still working) with the new CellRenderer interface. The original ListCellRenderer methods accept a List component which doesn't make sense for the new component, the CellRenderer interface resolves these issues.
Generally the class is a plugin replacement for a list with the addition of quite a few features from container through the ability to set the layout to anything we want, e.g. to accomplish variable size lists just use BoxLayout on Y_AXIS. To accomplish a grid just use grid layout as we do in the LWUIT demo that I just committed (see the video above).
The newest version of the resource editor now includes support for this component in the GUI builder as well as some other nifty features such as marking the components that have code associated with them.
Wednesday, April 6, 2011
Resource Editor Tutorial Rebooted: Introduction And Walkthrough
Yes a "do over" so soon for the resource editor tutorial. You must admit this one is way better than the last one.
While the first part is very verbose I'll try to keep the following to a more concise "How To" format which I think will be more helpful when integrated with the tool itself.
Subscribe to:
Posts (Atom)