Sun Java Solaris Communities My SDN Account Join SDN
 

Sun Mobile Device Technology - Chat Transcripts

 
 

Create a MIDP Application Using Drag 'n' Drop

 

Guests: Martin Brehovsky, David Kaspar, and Matt Volpi
Moderator: Bao Phan


bao
Welcome to the Sun Developer Network Moderated Chat series. Today's topic is "Create a MIDP Application Using Drag 'n' Drop." My name is Bao Phan and I'm the moderator for this chat. Our speakers today are Martin Brehovsky and David Kaspar, Software Engineers for the NetBeans Mobility Pack IDE. We are also joined by the Product Manager, Matt Volpi.

Just a couple of housekeeping notes before we begin:

You are connected to our chat application, and your session must be maintained in order to stay connected. Please do not point your current browser to another URL, otherwise you will be dropped from the chat. You may open up another browser if you need to access another URL while staying connected to the chat.

When you submit a question to the speakers, your question will not immediately appear in the chat room. It is sent to the speakers and will appear when the speakers post their response to your question.

With that, I'd like to invite you to begin sending your questions to our speakers. To start things off, David, can you give us a quick summary of the feature in the NetBeans Mobility Pack that allows you to drag and drop code?

davidkaspar
Rapid Application Development (RAD) is a commonly used technique for developing standard desktop applications. NetBeans Mobility 4.1 introduces Visual Designer, a RAD tool for developing J2ME/MIDP applications. In addition to drag-n-drop support for visual design and definition of the individual UI components, Visual Designer also offers the same intuitive drag-n-drop style of development to design and manage application flow.

usain
Dose it support both MIDP1.0 and 2.0?

davidkaspar
Yes, we support both MIDP versions.

[missing question]

martinbrehovsky
We believe we offer more than the Websphere Device Developer. As far as I know, the Device Developer allows you to design only the individual UI components. We allow you to also design the application flow – i.e., how the UI responds to commands. So basically you can design a complete MIDP application in our tool (not just the UI part). Concerning the second tool - I don't know it, so I cannot comment on it. But I will definitely look at it.

lokesh
Hi, I am a student trying to realize rtp streaming of mp3 files in MIDP. Is it possible to use rtp protocol in J2ME?

martinbrehovsky
Well, it depends on the individual devices. The MIDP standard does not support rtp, but some manufacturers might support this protocol. You need to check the particular devices.

DanG
Does drag and drop apply only to screen flow, a la pages in Creator, or for the actual UI elements of the application, i.e., buttons, sliders, etc?

martinbrehovsky
Actually both – you can design individual screens (e.g., forms, lists, alerts) in the screen designer and then you can connect them by defining their flow in the flow designer.

mad
What are the advantages of using an IDE, when I can code an application pretty easily?

mattvolpi
It's an excellent way to get things started with the basics and rapidly generate hundreds of lines of code, so you can instead concentrate on the more difficult parts of the application.

iwaneising
I haven't looked at the drag-n-drop facilities yet, although I'm familiar with the module. The reason I haven't used it, is that I already have a J2ME application and it seems to be quite a task to migrate to the format NB requires for the drag-n-drop features. There seems to be no guide to migrate, or a list of points to keep in mind when migrating. Is this planned?

davidkaspar
Currently, we do not support importing existing applications. We are planning to release tutorials to help people to easily migrate to our tool. We also plan to support 2-way editing, which allows importing existing sources seamlessly into the tool.

j2me
Can I import existing UI into the studio? I.e., if I have an application already created, can the tool import it, so I can manipulate the GUI visually?

mattvolpi
In this version of the Visual Editor, you can only work with new projects.

DanG
Is there a live demo of the drag-n-drop Visual Designer capability of NetBeans Mobility Pack 4.1? URL / pointers?

davidkaspar
Right now we are preparing a Flash demo with tutorials, where the basic functionality will be explained.

mad
What are the advantages of NetBeans over other IDEs?

martinbrehovsky
I believe we have much more complex support for MIDP application development. Our tool has a solution for device fragmentation (like antenna), we have localization support, and in 4.1 we are going to have the Visual Designer for visual UI development of MIDP applications. Also in 4.1 we are going to have a "Wireless Connection Wizard," which allows you to connect the MIDP application to a J2EE server. And above all, our projects are based on Ant, so you don't need the IDE to build your projects at all.

mesa
Is this a round trip editor?

davidkaspar
No, right now it is just a 1-way editor.

Jay
Are there any demo applications created with Visual Designer so we can see what it can do?

mattvolpi
There will be with the final release.

RKD
How viable is MIDP development for non-phone devices (e.g., Palm Pilots) and is this something MIDP/NetBeans will be supporting in the future?

mattvolpi
There is MIDP running on some non-phone devices. NetBeans code is compliant with the profile the user selects, so it could run on a non-phone device, however some APIs will not be available that relate to telephony, etc.

iwaneising
How performant is the generated code? J2ME devices have limited resources, one of the reasons I am looking towards the Javalution library. Can this be used by the module so it would use those packages for generated code, e.g, by specifying preferred packages?

martinbrehovsky
The performance of the generated code should be fine, for example we support lazy initialization and we always try to use the fastest way of constructing components – i.e., adding an array of items to forms or lists and so on. Concerning Javalution – I don't know this library (I will look at it), but I'm afraid it will not be possible. We are generating strictly MIDP1 or MIDP2 code (you can add custom components like canvas or custom items, though).

lokesh
If we want to use rtp then do we have to create a custom datasource class?

martinbrehovsky
I'm afraid you will have to create a client implementation of the rtp protocol, or somehow "translate" rcp into some other protocol.

j2me
How many controls are supported with this release?

martinbrehovsky
We support all MIDP1 and MIDP2 classes from the javax.microedition.lcdui package. You can also add your own custom components, like Canvases or CustomItems.

usain
When I regenerate code will it overwite the existing code?

davidkaspar
If you had created a MIDlet using our Visual MIDlet file template, there is a read-only section in it. This section is regenerated everytime there is a change in the application and you are saving the file or switching to Source view. Otherwise the section will not exist and therefore will not be regenerated.

dobr_pan4ev
Hi, the NetBeans IDE is getting better every day! Will the wireless connection wizard (WCW) support web services – WS-I, RPC – and will we be able to pass serializable objects between the phone and the J2EE server?

mattvolpi
Currently you can use the WCW with 3 tiers of architecture in order to consume web services. You should use Web Project and create a web services client, then use the WCE and access this client. This version supports only primitive types – strings, arrays, vector, and hashtable.

RKD
Which J2ME APIs are simulatable and/or 'drag'n'drop'able' at the moment? Specifically, things like Bluetooth and/or 3D capabilities?

mattvolpi
Only basic MIDP components are available right now. However, you can add custom components to the pallette for easy re-use.

javageek
So, RAD for web GUI via Creator, RAD for J2ME apps via NetBeans Visual Editor...the cross-over point would be RAD of J2ME apps that either use JSR 172 or the new WCW...can we arrange to have one of the tutorials address RAD of J2ME apps against web services?

martinbrehovsky
In 4.1 we are going to support applications which use WCW and Visual Designer. You can already try the functionality by downloading the latest Mobility Pack q-builds from http://www.netbeans.info/downloads/download.php?a=n&p=1

marco
Is it possible to add vendors' emulators? E.g., the Nokia or Sony Ericsson JDKs?

mattvolpi
Yes, all UEI compliant emulators can be added, including those from Nokia and Sony Ericsson.

bao
Please see our technical article, "Easy Emulations with New NetBeans Mobility Pack" at http://developers.sun.com/mobility/nbpack/reference/techart/nbmp40-emulators.html for information on how to add emulators.

lokesh
Is there any way we can stream the audio content in mobile phones other than using http protocol?

martinbrehovsky
MIDP2 compliant phones should support sockets, so you are able to implement whatever protocol you want. On MIDP1, though, you are limited to HTTP.

WM
How can I create a custom component?

mattvolpi
You just create them as a class and then add it to the pallette.

WM
Hi, folks, I've joined late and hope this question hasn't been sent yet: About Canvas classes with Drag-n-Drop?

martinbrehovsky
Yes, Canvases are supported as well. You can work with them in the same way as with other Screen components – you can assign commands to Canvas and include it in your application flow design.

RKD
Does the whole/any of the MIDlet need to be under the aegis of your UI designer to use the draggable app flow? I.e., could one manipulate a game's "business logic" using the app drag aspect and, perhaps, ancilliary GUI components like initial menus? (Hope that made sense – you kinda see what I'm getting at!)

mattvolpi
The UI designer can only be used with new projects/MIDlets. At this time you cannot drag-and-drop onto pre-existing files.

UlfZibis
Is there any workaround for a problem I discovered in porting a project created with the build from 15 March to the beta?

martinbrehovsky
Can you give me more details?

WM
Is it possible to use your own Java libraries, or frameworks, within Visual Designer? Could you tell me a bit more about it?

martinbrehovsky
Sure, you can use your custom visual components (i.e., components extending either Displayable or Item), though in a limited way in the screen designer.

RKD
Regarding my previous question: Same question but specifically having created with the tool?

mattvolpi
As long as you don't change anything in the UI, it should be OK.

WM
Is it possible to create Custom Items and let them be used throughout the project as an existing library?

martinbrehovsky
Yes.

bao
Here's a note from our docs writer:

javawriter
There are plans for a tutorial that includes the WCW and Visual Designer together. Hopefully it will be out soon.

marco
This might sound daft, but what is exactly WCW?

mattvolpi
Wireless Connection Wizard, used for building mobile apps that connect to enterprise services.

Dee
The Screen Design view uses your own MIDP implementation to render the MIDP widgets. This means they look different when rendered by a UEI-compliant emulator (e.g., the Sony Ericsson SDK). Are there any plans to integrate the emulator's renderer into the Screen Design view in some way?

martinbrehovsky
Well, the problem with MIDP rendering is the fact that every device manufacturer uses its own look and feel (e.g., MIDlets on Nokia phones look completely different when running on Sony Ericsson or Siemens). We are currently investigating ways for how to use the emulator to render the screen in the designer.

[missing question]

davidkaspar
All methods and important parts generated in the source code contain JavaDocs and comments describing their functionality and how to change them using the visual tool. There are Code Generation properties on many components which allow you to optimize the generated code. For example: Lazy-Initialized property allows you to specify if the component should be created in startApp method or if it should be created lazy (when the component is really used).

WM
About custom components and canvases, I couldn't figure out where and how I can deal with them in the IDE. Could you point me to them?

martinbrehovsky
You have to add them to the component palette first (use the Customize button in the palette or the Tools/MIDP palette manager). Then you can drag and drop them as any standard MIDP component.

usain
My concern is the generated code is usually long. How about with this IDE?

mattvolpi
For this type of tool, the code is on the smaller side. Obfuscation will also decrease the size significantly.

iwaneising
When I want to create a MIDLet for various devices, I currently use the conditional code-blocks. Will the UI designer create these as well when I change the target device? So in other words, does the Visual Designer support multiple target devices while "drawing" the GUI once?

mattvolpi
The Visual Editor does not handle this, however, after creating your application with the Visual Editor there is support for a conditional device fragmentation solution.

pretek
I am interested in porting applications written in C# to Java. I have access to the UML files that were used prior to development of the detailed code. Where is there a list of UML file formats by vendor that I can use to import the UML to generate the skeleton code for Java NetBeans in general and for MIDP2 and J2ME in particular? Are there any "poor man's" C# to Java code porting tools out there?

martinbrehovsky
There are 3rd party UML tools which should be able to load UML designs and generate Java code. Sun Java Studio Enterprise 7 includes a UML tool which should be able to do this (it is a commercial product, though).

Jay
Obfuscation will decrease size, but will it not increase the time for the implementation of new features and/or debugging time?

martinbrehovsky
I don't think so. The obfuscation works on the level of bytecode, so there is no impact on the source code. Concerning debugging, you usually debug non-obfuscated code.

iwaneising
So far I haven't been able to use OTAP through the NetBeans module. I get some strange error on either the emulator or my mobile phone (Nokia 6230). The tutorials I seem to find are all based on old versions of the Wireless Toolkit. Will it be possible to debug OTAP or other means of deployment as well with the 4.1 version?

martinbrehovsky
Can you give us more information? Ideally on nbusers@netbeans.org list?

thomasr
Do you support J2ME unit tests? I've seen that the jar is in the ext folder but could not see any support in the wizard so far.

mattvolpi
There is no UI support for this.

dobr_pan4ev
Traditionally we add Items to Form using append(...). Does the IDE generate similar code?

davidkaspar
No, Items are added into a Form using the constructor parameter of Form class.

iwaneising
To get back to my previous question: Do I need to draw the GUI for each target device and the tool will create the various device-fragmentation blocks for me? Or do I just select a new target device and the tool will automatically generate the same code for the new target device?

mattvolpi
You do the GUI once, and device fragmentation must be accounted for in the actual code. NetBeans has an easy solution for creating device categories to simplify this process.

UlfZibis
This question is being asked by my colleague, so I will try to describe it as best as I can. In one of the versions you can only insert a method call in the write-protected code area. In the other version it's possible to insert more code lines. When porting back, an error occurs when more than one code line exists.

mattvolpi
We do not have backward compatibility for daily builds or q-builds.

davidkaspar
We recommend that you upgrade to the latest version of the Mobility Pack where you could insert more code lines into the different parts in the write-protected code area.

marco
Can the actual audio capabilities of phones (mic / loudspeaker) be simulated on the JDK?

martinbrehovsky
Audio devices should be supported out-of-the-box (MIDP2, MMAP). Concerning input devices – the support depends on the particular emulator. For example, some emulators can have support for a camera or microphone, others might not. It's the same situation as with real devices – some of them support capturing video/photos from an embedded camera, some do not.

WM
Do you have some more documentation, tutorials, or anything else about handling custom components besides the IDE Help?

martinbrehovsky
We are planning more tutorials and articles with the final release of the tool.

bao
You can send any tutorial and documentation requests to nbusers@netbeans.org. Our documentation team takes all requests into consideration.

Please include "j2me" in the subject line for faster response.

WM
If I can leave one, I suggest you publish an article, or even a resume sheet, about customizing components. That could boost the desirability of the Visual Designer for deeper, more professional usage.

bao
I will make sure our writer sees this request. Thank you for submitting it.

bao
From our writer:

javawriter
Articles and tutorials are being written and released on a continuing basis. Please keep requesting the types of articles you want, and we'll try to meet your requests as soon as resources allow.

[missing question]

mattvolpi
There are non-Sun VM solutions for some PDAs. You can still use NetBeans to write code for these, although you will need to pay extra attention when debugging on the device, since the NetBeans implementation is based on the Sun Wireless Toolkit reference implementation.

iwaneising
With version 3.5 of the module, a lot of emulators were included out-of-the-box, but since the 4.0 version they're missing. Will they be included in the final release, or at least a list of URLs where to download them from? The UEI compliant ones I mean?

martinbrehovsky
We currently bundle the Wireless Toolkit (WTK) 2.2. If you would like to choose a skin of the device, you can go to the project properties and select a different device (skin in the case of WTK). Or you can install more UEI compliant emulators (UEI compliant).

bao
You can also see our technical article, "Easy Emulations with New NetBeans Mobility Pack" at http://developers.sun.com/mobility/nbpack/reference/techart/nbmp40-emulators.html for information on how to add emulators, as well as links to emulators that you can download.

iwaneising
When is the release planned? And do we need to wait for the final release before we get to see the tutorials you mention?

martinbrehovsky
We are planning to release this version in the beginning of May. For more information watch www.netbeans.org.

marco
I found the "process flow" graphics great, and I assume this would be a great tool to document the development, too. However, I found it a bit disappointing that the actual "connectors" (for want of a better word) could not be "routed" – so they were overlapping and, in actual fact, making the whole diagram a bit confusing. Is there any plan to make the "connectors" freely routable?

davidkaspar
Not in this release. We are collecting feedback on the release. If we have more users interested in this feature, we will be happy to implement it. Feel free to enter an RFE into Issuezilla on the netbeans.org site.

iwaneising
Does the tool also support WAP/WML development beside MIDLets?

martinbrehovsky
Currently there is no direct support for developing WAP/WML applications, though you can use NetBeans to develop web applications, which in turn can use WAP/WML.

bao
Okay, we are coming to the end of our hour. Martin, David, and Matt, do you have any last thoughts for our guests?

mattvolpi
Thank you all for your participation and great questions – you have kept us busy! We will take your feedback into consideration as we prepare to launch and support this version of the Mobility Pack and prepare for our next one. Stay tuned to the NetBeans.org web site for more information, as we are always adding articles and tutorials, and, of course, check out our final release of version 4.1 soon.

Here are some screenshots to whet your appetite:
http://www.netbeans.org/images/screenshots/4.1/nb_midp_visual_editor.png
http://www.netbeans.org/images/screenshots/4.1/visual2.png

bao
Great, thank you. This wraps up our chat for today. I'd like to thank you all for your active participation, and our speakers for doing a great job in answering your questions. I hope you found this information helpful, and this live chat valuable.

An archive of today's chat will be posted on our web site. All registrants will be notified via email once it is available. On behalf of the team here at Sun, thank you and goodbye!

usain
Thanks M, D, M, and bao.

WM
Thanks again.

thomasr
Thanks.

iwaneising
Thanx.

UlfZibis
Thanks also from Germany, it is now 19:59 h.

...I will also say, this is a good time for Europe !!!

bao
Thanks for the feedback, that is very helpful!

Update Your Java Runtime Environment

NetBeans