Deep Dive on NetBeans Mobility Pack 4.1
Transcript of web chat held on June 02, 2005
Guests: Sigal Duek, Petr Suchomel, David Kaspar, Adam Sotona and Matt Volpi
Moderator: Tiffany Bianco
tiffany
Welcome to the Sun Developer Network Moderated Chat series. Today's topic is "Deep Dive on NetBeans Mobility Pack 4.1." My name is Tiffany Bianco and I'm the moderator for this chat. Our speakers today are Martin Ryzl, Sigal Duek, Petr Suchomel, and Adam Sotona, Software Engineers for the NetBeans Mobility Pack. 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, can you give us a quick summary of the new features in the NetBeans Mobility Pack 4.1?
adamsotona
- Visual Mobile Designer: Drag-and-drop objects into the Flow Designer, Screen Designer and Action Editor to automatically generate Java code for rapid development and prototyping.
- Wireless Connection Wizard: Easily access web services and other server-side data from MIDlets via servlets.
- New Deployment Options: Upload your MIDlets via WebDAV, FTP and SCP from within the IDE.
sigalduek
For more information: http://www.netbeans.org/kb/41/whatsnewmobility.html
mattvolpi
So, does anyone have any questions about the new release?
scallywag
I've played with the visual designer and created a multi-form app quickly. However, the generated code (multiple forms and a listbox) was one single class. Is there a reason for this?
davidkaspar
Yes, there is. We wanted to minimize the memory consumption of the generated code.
jess
There is a src filter. Is there any way to filter out resources too?
adamsotona
Source filtering is available in project properties, resources can be filtered when lying under source root only.
jess
In the Flow designer, only high lever UI supported. When will netbean support canvas?
petrsuchomel
I do not have an exact answer now, but we are planning and investigating more options and scenarios how to support Canvas/GameCanvas in future.
scallywag
So....this is sort of a best practice in the J2ME world? (newbie)
davidkaspar
The problem is that MIDP 1.0 has 64kB memory limit. Therefore you have to optimize the code for it. One of the possible optimalization is to reduce the number of classes in your project because each class cost about 200B.
JimW
Folks - the new Visual Mobile Designer shows real promise. To continue an earlier question from scallyway...do you anticipate, in future releases, that we will have the option to visually design things like Forms as independent objects that can be used by multiple Midlets?
adamsotona
Yes, this is planned for future releases.
Neil
We are very new at this. Our software applications are very mature but are not yet accessible from wireless devices and we want to expose them for use to wireless users. You must work closely with hardware manufacturers and third party software developers. Can you tell me, without revealing confidential information, where the Net Beans Mobility Pack is being used? For example, is its use primarily with Java based Cell Phones or are there other devices?
mattvolpi
Mobile phones are the primary target device for NetBeans Mobility Pack, primarily because of the compatible SDKs. However, any device running J2ME can be addressed. Most of our users are targeting Nokia, SonyEricsson, Siemens & Motorola devices.
Eli
Is it possible to delete code created by the designer?
davidkaspar
Not currently. We support only 1-way generated code (from the designer to the source code) which is placed into guarded block. This block cannot be modified by user directly in the source code.
Max
Does anybody know how to run or import my own build target in Netbeans?
adamsotona
You can freely write (copy/paste) such target into your project build.xml and use it. Hints which target to override and how to do it are available there.
scallywag
Ahh...thank you. Makes sense. Just much different than the J2EE world I live in. Do you envision the visual designer to be mostly geared for prototyping or for full-fledged development projects?
petrsuchomel
Well, NetBeans Mobility scale is from beginner to real "full" projects. The full is our most important target.
jess
Where can I find the built-in profiler?
sigalduek
Tools -> Java platform Manager -> J2ME Wireless Toolkit 2.2 -. -> Tools and Extensions Check the Profiler checkbox.
WM
Hi folks, and nice job with VMD. I've been experimenting some testing and it really works very well, even with custom components I've added to Netbeans.
mattvolpi
Thanks, we're glad you like it.
scallywag
Another stupid question - any plans to somehow integrate junit with J2ME development?
adamsotona
There is already available a J2MEUnit library that is an equivalent of JUnit for MIDP. You can attach the library to your project in project properties dialog/Libraries and Resources category. Support for J2MEUnit tests generation is planned for the next release.
jess
How about methods overhead?
davidkaspar
All generated methods are private and therefore could be removed by obfuscator during build process. Also if you set a "Lazy-Initialized" property on any component to false, the appropriate method will not be generated and the component will initialized in the initialize method.
tiffany
We're getting a lot of great questions here, and the speakers are busily typing their responses as fast as they can. We appreciate your patience, and encourage you to keep those questions coming.
bitrace
Is it possible to build to either MIDP1.0 or MIDP2.0 for 3rd party emulators (i.e Nokia). The MIDP1.0/ CLDC1.0 options seem to be grayed out in Nokia MIDP2.0 emulators?
adamsotona
Yes, some Nokia emulators provide only MIDP 2.0 environment so primary you will have all MIDP 2.0 classes available in editor and for compilation. But if you take care and create a MIDP 1.0 application you can override the MicroEdition-Profile attribute in project properties/Attributes category.
mattvolpi
You can also get an older Nokia emulator, such as the 3300, that supports only MIDP 1.0, for that purpose.
bamsham
I will like to congratulate the Netbeans team for yet another successful release of Netbeans. I have used Forte for 1 year before it became Sun One Studio. I have experimented a bit with current release and find it more useful then most current IDEs for Mobile Development and strongly believe that you guys have the clear idea of what an IDE should be. Forte had SDI and MDI long before eclipse(which supoorted it in version 3.0). It is really useful when one is developing using multiple monitors. I have noticed with Forte 2 things in general. First, it was too slow [in compiling, execution, etc]; second, over the course of development we also noticed that Forte required frequent restarts of IDE[I guess to free up resources like memory, etc]. So my first question is that what were the efforts and consideration during the development of Netbeans Mobility 4.1 to handle these inefficencies of Forte?
petrsuchomel
The NetBeans learned a lot from previous issues: Since 4.0 we have new, efficient ANT based build system and projects, very good performance, nice UI, out of box experience.
We have support for J2EE and J2ME developement out of box.
WM
Well, since nobody is perfect, I would like to suggest some more advanced info about how VMD handles the environment, like lazy initiation parameters for objects like commands, classes, and how it interferes with generated code, and further, the real performance in the mobile device.
davidkaspar
It is a long story. All properties which affects the style of generated code are ones in the "Code Properties" set on each property. The most important is the "Lazy Initialized" one and "Generate Threaded Command Listeners" which allows developers to perform all command action in a separate thread that does not block the UI. This is mainly used for network communication. If you have any question, please, write an email to nbusers@netbeans.org. I am looking forward to your mails.
WM
Ok, I'll do that, and ask you if there exists a specific topic, forum or discussion list about mobility and VMD, and case not, would it be possible? I think that could help us a lot.
mattvolpi
We're exploring creating forums for this purpose right now.
tiffany
We encourage you to keep sending questions to the speakers. Does anyone have questions they would like answered?
scallywag
Will we get a copy of this chat emailed to us?
tiffany
The chat transcript will be posted on the Mobility web site in a couple of days.
adamsotona
If nobody asks, I have one question to all: How do you deliver your applications to the mobile devices ? (over web, cable, which tools do you use ?
jess
For development, of course the infrared, cable, bluetooth.
But for users, they should only be able to download OTA.
jess
Actually, I accidently got a wrong device for my project. The device was MIDP 2.0 but I want to change it back to MIDP 1.0. I tried to change the property file, it didn't work. Do you know why?
adamsotona
You can freely change the device in project properties dialog/Platform category. If your emulator does not support MIDP 1.0 you can download and install another or use the workaround I describe before.
bamsham
There are 2 main areas of for J2ME a) Enterprise Applications and b) Mobile Gaming In Enterprise Application. We would mostly have 3 Overall Modules[based on functionality, 1) Http Module (To send data back and forth using the HTTP connection) 2) RMS module 3) Graphical module (Mostly using forms,etc) Optional Module could be "Connectivity" using Bluetooth, IR, Cable, etc. Same would go for Gaming Applications They will have logic (Rules) graphics rendering HTTP module. My Question is that do Netbeans look forward to making these functionalities available as features so that we do not have to cut copy paste the code?
petrsuchomel
For enterprise application, we currently have wireless connection wizard, which allows you to create Mobile to Web application just in one minute. If you haven't tried this yet, I can only strongly recommend.
For visual development, there is Mobile Visula Designer. For other types, like RMS, Bluetooth, IR, we are investigating options and requirements. For gaming, I mentioned, we are investigating support for GameCanvas and do on.
This functionality can be template based (pieces of code) or libraries. If you have any suggestions, please send them to nbusers@netbeans.org or fill in RFE in Issuezilla: http://www.netbeans.org/community/issues.html under 3-rd party/j2me
davidkaspar
Hello, we would like to ask you all a question regarding the code generation in the Visual Designer. Currently the generated could not be modified directly in the source code but only through the designers. Is this sufficient for your development or would you like to have a possibility to modify the source code directly? The source code will be automatically recognized by the designers and they will change their structures according to the new code.
lojza
What are Abilities in Project Properties good for?
adamsotona
Abilities are preprocessor keywords. You can make some piece of source code optimal if some ability is or in not present in certain project configuration. For example: all Nokia project configurations will probably contain NokiaAPI ability so you don't need to list all the nokia configurations in the preprocessor condition but the only one ability.
tiffany
Housekeeping note: We have 15 minutes left in our chat session today. Please get your questions in now.
lojza
I created a Midlet for MIDP 2.0 in Visual Designer but I need it to be runnable as MIDP 1.0. How can I remove the MIDP2 parts of code when they are in guarded block (uneditable)?
petrsuchomel
There is action on MVD node which allows you changing code to MIDP 1.0 compliant style.
WM
Which woud be the best way to apply an "if then else" condition within a supposed form, where one of its textfields where inconsistent to keep going on inside that form?
davidkaspar
In this release we do not support the if-then-else components. There is only one way how to implement that. You could create an regular transition from the source port to the target component which should show on true condition. Then double-click on the transition for opening the transition customizer. To the "Pre-Action User Code" area type this: if () { To the "Post-Action User Code" area type this: } else { Display.getDisplay (this).setCurrent (get_falseDisplable ()); }
jess
Could you provide a detailed example to elaborate how to use "Abilities"?
adamsotona
Yes: Think about distributing your application for several devices so you will create an appropriate project configuration for each. For example Nokia_Series40, Nokia_Series60, SonyEricsson, Motorola. Some of your code will depend on Nokia-specific API but you could not use it on devices that does not support such API. You will create an ability called NokiaAPI and assign this ability to both Nokia project configurations. Your code will be then conditioned by NokiaAPI ability (not by listing af all devices). Then you will notice that SonyEricsson devices also support Nokia proprietal APIs so you will just add NokiaAPI ability to the list under SonyEricsson project configuration in project properties, and rebuild the application. :)
jess
What does configuration in NB IDE mean? DefaultConfiguration is..?
mattvolpi
This basically refers to the emulator platform and J2ME version you are targeting (i.e. MIDP 1.0 vs. 2.0; CLDC 1.0 vs. 1.1). The default will be set the the Sun Wireless Toolkit that is installed along with NetBeans Mobility Pack.
bamsham
This is in Regard to DavidKasper, It would be great if that could be done. That would be a very fundamental Mindshift. In the long run I think we as developers would definately need that ability in Netbeans. You could see exponential increase in newcomers adopting the IDE, seasoned developers.
Eric
Does the Wireless Connection wizard support other types of connection than the Mobile to Web? Our application may request mobile to call and connect remote server in case no web connection, is it possible?
petrsuchomel
Do you mean use other connection type than HTTP? Could you clarify?
WM
How could I, if possible, change the MIDlet class reference in the VMD to an custom MIDlet's subclass where some particular methods were already written?
davidkaspar
No, it is not possible because the Visual Designer works only with MIDlets and every usage of: Display.getDisplay () has hardcoded the "this" value. For next release we are planning to change it to following pattern: Display.getDisplay (getMidlet ())
bamsham
From Desin Patterns and Architecture point of view , just curious if you are using Service Oriented Architecture in development of Netbeans. If not, which patten is being used or a mixture of many?
petrsuchomel
I do not understand your question very well. Do you mean, which patterns are used for NetBeans development itself?
bamsham
yes
davidkaspar
Thank you all for feedback on the code generation question.
jess
Thank you for the excellent work!
Eric
Yes, I mean use other type of connection type than HTTP, is it possible to set in the Wireless connection wizard?
petrsuchomel
Not now. We are using HTTP, because for MIDP 1.0 the only HTTP is protocol always available. Good point, I'll put the other types of connection into the evaluation.
WM
About MIDlet subclasses, I meant using custom library attached to the project and one of the classes were a subclass of the MIDlet class. So, if instead of the "...extends MIDlet" I could use "... extends MySubclassMIDlet" right in the generated source file?
adamsotona
Yes, you should not have any problem with that.
WM
Yes, but how to do this without put my dirty hands in the generated source code. Any parameter, or something like that?
davidkaspar
If you are just extending the class, everything will be working out-of-box without any change in the generated code.
bamsham
Thank you for your answers. I wish you great success with Netbeans.
tiffany
Okay, we are coming to the end of our hour. Martin, Sigal, Petr, Adam, and Matt, do you have any last thoughts for our guests?
mattvolpi
We're now wrapping up. Thank you all for attending and participating in the chat. Remember that the transcript will be available soon on the SDN site. Also, please check out the new articles about the NetBeans Mobility Pack at the NetBeans.org web site. For those of you attending JavaOne or who are in the San Francisco area, you are invited to the FREE NetBeans Day on Sunday, June 26th at the Argent Hotel.
tiffany
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.