Saturday Aug 18, 2007

[TIP] Using SVG Menu In Visual Designer

The SVG Support in NetBeans Mobility Pack give you new SVG aware components. I already blogged about the SVG support and created a short flash demo.
I'd like to explain how to work with the SVG menu component in this blog entry.

There is SVGMenu component in the palette of Visual Designer in Mobility Pack. You can add SVG Menu Element to the SVGMenu. The SVG Menu Element can be then bind to an element with ID in the SVG image.
	<text id="menuItem_0" ... >
You can do it either manually in Properties of a SVG Menu Element by naming the SVG Menu Element exactly same as the ID or you can follow the SVG Menu Item pattern when creating IDs of the elements in your SVG image. The pattern is "menuItem_NUMBER". When you assign a SVG image with IDs that follow the pattern to the SVGMenu component then the SVG Menu Elements will be created automatically for you. You can watch screencast to see it in action.

SVG Menu Screencast Demo Flash

Tuesday Jul 31, 2007

[TIP] Generate Values to JAD During Build Process

Sometimes you need to modify the build process of your project. There is build.xml file in your project directory that drives the build process. To open it in NetBeans, you have to switch to Files view (at least in Mobility project type). When you open it in the editor you might be surprised that there is only an import of build-impl.xml file and a comment in this file. Yes, the main build targets are defined in build-impl.xml file but you should never modify it because it's a generated file. If you want to add a build target or modify/overwrite an existing one you should do it in the build.xml

You don't have to overwrite the existing targets. There are defined following empty targets that you can define in your build.xml. And they will be run in the right time in your build process.

Defined pre/post targets:
  • pre-init: called before initialization of project properties
  • post-init: called after initialization of project properties
  • pre-preprocess: called before text preprocessing of sources
  • post-preprocess: called after text preprocessing of sources
  • pre-compile: called before source compilation
  • post-compile: called after source compilation
  • pre-obfuscate: called before obfuscation
  • post-obfuscate: called after obfuscation
  • pre-preverify: called before preverification
  • post-preverify: called after preverification
  • pre-jar: called before jar building
  • post-jar: called after jar building
  • pre-clean: called before cleaning build products
  • post-clean: called after cleaning build products

Generate Values to JAD during build process
You need to know what target you want to override, of course. I found out from the build-impl.xml file that the jad is created as part of the jar target. Therefore I will define the post-jar in my build.xml.

Modified build.xml :
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->>
<project name="" default="jar" basedir=".">
    <description>Builds, tests, and runs the project .</description>
    <import file="nbproject/build-impl.xml"/>
    <target name="post-jar">
        <!-- add all properties that you want to the JAD file -->
        <nb-output file="${dist.dir}/${dist.jad}" encoding="UTF-8" append="true">Lukas_property_1: Blablabla
        <nb-output file="${dist.dir}/${dist.jad}" encoding="UTF-8" append="true">Lukas_property_2: ${name}

Please note that the not-intended </nb-output>. It's by purpose. The nb-output task copies the text as it is to the file.

The jad file will look like :
MIDlet-1: VisualMidlet, , VisualMidlet
MIDlet-Jar-Size: 62157
MIDlet-Jar-URL: MobileApplicationSVG.jar
MIDlet-Name: MobileApplicationSVG
MIDlet-Vendor: Vendor
MIDlet-Version: 1.0
MicroEdition-Configuration: CLDC-1.1
MicroEdition-Profile: MIDP-2.1
Lukas_property_1: Blablabla
Lukas_property_2: MobileApplicationSVG 


Monday Feb 05, 2007

Hands on Lab Proposals for Mobility Packs

We posted 3 proposals for hands-on lab (HOL) sessions at JavaOne 2007. I'm really curious if they will accept any of them. The hands-on labs are about Mobility Pack and Java ME development. One of the HOLs is just update of the last year session LAB-6205 Mobile Applications: Visualize it, Build it, Deploy it to Many Devices. The other two are brand new. I'm working on them now. Even if they won't accept them for the session I'll publish them on this blog or at

The Proposals For New HOLs

Title: Advanced Java ME Programming - Streaming Video From Server to Your Device

  • Exercise 1: Play the video on device
    • Objective: Remember audience about MMAPI. The users will develop a mobile application playing a video on device.
    • Expected duration: 30 minutes
    • Brief description: The MMAPI is quite complex set of APIs. The exercise will focus on the APIs necessary for playing a video on a device. Result will be MIDlet that can play a video. This MIDlet will be used in next exercises.
  • Exercise 2: Connect to web service, stream the video from the server
    • Objective: The users will develop a mobile application consuming a web service using J2ME Web Services API (JSR 172). The J2ME Web Services API eliminates the need for developers to include code for remote invocation and XML parsing in each application.
    • Expected duration: 45 minutes
    • Brief description: Communication between the MIDlet and the appserver will be handled by the JSR 172. Application server will provide a webservice that will list available videos. When user will choose one of the videos it will be streamed to the device. We will accommodate the MIDlet created in Exercise 1 to play the video on the device.
  • Exercise 3:
    • Objective: The audience will learn how to solve connecting to webservices on devices without JSR 172 by utilizing device configurations within the IDE. They will generate different distribution packages(JAR/JAD files) using one set of source files for all distributions.
    • Expected duration: 45 minutes
    • Brief description: Attendees will learn how to work with more SDKs/emulator platforms in the Mobility Pack. They will change the project to run on devices with the support for JSR 172 and even on devices without the support for JSR 172. The result will be two different application however they will look the same for the end user of the application. The application will move from two tier architecture (client-server) to three tier architecture in the case when JSR 172 will not be used.

Title: Scale your Java ME world with Java API for SVG

  • Exercise 1: Get in touch the SVG technology in Mobility Pack
    • Objective: Explain the SVG (JSR226) to audience. Show the SVG support in NetBeans Mobility Pack 5.5
    • Expected duration: 20 minutes
    • Brief description: What is SVG (JSR226) about, what is it good for. What SVG components are in the Visual designer. Show SVGImage component. Describe SVGMenu component and its capabilities. How to define flow of the application
  • Exercise 2: Create first application with SVG
    • Objective: Create mobile application that uses the SVG technology. Run it on more phone emulators to show its scalability.
    • Expected duration: 45 minutes
    • Brief description: Create new mobile project. Import SVG images into project resources. Create splash screen with SVG image. Create SVG menu. How to run SVG animation in a screen. Run the application on more phone emulators with different screen size.
  • Exercise 3: Changing the objects on SVG image
    • Objective: Show how the SVG image can be manipulated on the fly. Lets user to manipulate the SVG elements.
    • Expected duration: 40 minutes
    • Brief description: Users will learn manipulate with the svg elements used in the application created in Exercise 2. The result will be a SVG image showing current time. How get the right xml element of the SVG image. How to change the SVG image on fly.
  • Exercise 4: Advanced features
    • Objective: Present features of NetBeans Mobility Pack that will help users when creating a SVG application
    • Expected duration: 20 minutes
    • Brief description: The business logic and the UI is separated in SVG. Therefore it is easy to change the UI of the application. With NetBeans Mobility Pack you can easily change the application for devices that don't support the JSR 226. The IDE can generate PNG image from the SVG images for target devices. It will care about the right width and height of the image automatically. How to easily change the UI of the application. Generate PNGs from the SVG graphics - solution for the phones without JSR 226. Run external SVG editor from IDE.

Any comments/improvements for the proposals are welcome!

UPDATE: They accepted the "Streaming Video From Server to Your Device" hand-on lab. It seems that I'll go to JavaOne this year. Now it's time to write the hands-on lab :)

Wednesday Jan 24, 2007

CDC Pack 5.5 is released

"I'm sick and tired". Lying in my bed with high temperature and angina. Outside it's snowing like crazy. I'm glad that I parked my car in a garage. Otherwise I wouldn't find it anymore under the snow. It seems that the weather changed to winter in Prague finally. The forecast is -18 for Friday night. The temperature changed almost 30 degrees (last Saturday it was around +12 in Prague). I'm talking in Celsius, of course ;)

Enough of the bad news. It's time for something positive...

We released final version of NetBeans Mobility Pack for CDC 5.5. Finally.

I have to say some things about the release.
  1. (+) - it works out-of-box. Install it, create new project and you can create an application for CDC platform.
  2. (-) - the bundled CDC platform (Sun Java Toolkit 1.0 for Connected Device Configuration) supports only a AGUI optional package. You will not find the AGUI on any real phone. (The SavaJe is gone).
  3. (+) - we do have nice support for a Ricoh/J platform. Most of you will never see the SDK (you have to pay for it). Maybe you'll see at least the result of this support. Applications in your Ricoh printer created with the Mobility Pack for CDC.
    We also have a new toy from Ricoh. It's pity that we hadn't received it earlier. Color printer. I hope that Petr will allow me to deploy an application to it. Or to print a page at least ;)
  4. (-) - this is the first and also the last final version of the CDC Pack. The both packs will be merged in Milestone 7.

Wednesday Jan 17, 2007

Milestone 6 of Mobility Pack

Milestone 6 of NetBeans Mobility Pack 6.0 (Dev) is now available for download at

Milestone 6 has following new features:
  • JSR 172 Stub Compiler Rewritten
  • Visual Designer 2
You can find more details about these features at

Overall report for Mobility Pack M6 is available as well

Wednesday Jan 03, 2007

5+5 Questions About Mobility Pack for CDC 5.5

The Release Candidate of NetBeans Mobility Pack for CDC 5.5 was released in December.
Mobility team would like to improve its usability and quality for the next release therefore there is new survey.

Please answer the 10 questions of the survey to help to improve the quality and usability of the Mobility Pack for CDC.

Tuesday Jan 02, 2007

[TIP] Add Attribute to JAD/Manifest

When you need to add a new attribute to your JAD or manifest file you can set it up in project properties of a project in NetBeans Mobility Pack.

Open "File | YourProject Properties" (or right clict to project and choose "Properties". Then select "Application Descriptor | Attributes". You can add new attributes or edit/remove the existing ones. You can specify whether your attributes will appear in JAD or Manifest (or in both).

You can define different set of attributes for different configurations.

Tuesday Dec 19, 2006

Release Candidate 1 of MobPack for CDC

The NetBeans Mobility Pack for CDC 5.5 is releasing the Release Candidate 1. Please report all issues that you'll find with this build to Issuezilla. Sun Java Toolkit for CDC 1.0 is bundled with the Pack.

Thursday Dec 07, 2006

Can MobPack Run on Vista?

The next version of Windows is "coming soon" (is it good news or bad news?). They call it Windows Vista. We can expect that lot of users will migrate to this new operating system. Therefore we have to be prepared for them. I tested following products on Windows Vista RC1 - NetBeans 5.5, Mobility Pack 5.5, Mobility Pack for 5.5 CDC, Sun Java Wireless Toolkit for CLDC 2.2, 2.5 (aka WTK), Sun Java Wireless Toolkit for CDC 1.0. All of them worked without any problems...

Don't hesitate to report a problem with NetBeans or Mobility Pack on Vista.

On the left side is a screenshot taken on the Vista with running NetBeans Mobility Pack + WTK

Saturday Dec 02, 2006

Mobility Pack 5.5 for CDC bundles CDC platform

We are going to produce RC1 of NetBeans Mobility Pack 5.5 for CDC next week (hopefully). There is lot of bugfixes in this RC.
There is one more big news. The Sun Java Toolkit for CDC is bundled in the Mobility Pack for CDC installer. It definitelly ioncreased the size of the installer but it will increase usability. Now the Mobility Pack 5.5 for CDC works out-of-box. Just install it and you can start working. Cool.

On the right side is screen shot of the new skin of the CDC Toolkit emulator. Doesn't look cool? (the screenshot was taken on Windows Vista)
The only sad thing about the Sun Java Toolkit for CDC is that it supports only AGUI. It means that if you want develop an Personal Profile application you will have to download another emulator (SDK).

Do you want to try it?

This is the main channel to share news, tips and other stuff related to my work. Sometimes you can find even personal stuff. Enjoy your reading...


« August 2016

No bookmarks in folder