|
|
||
Bruno Ghisi's BlogCommunity: NetBeans ArchivesStarting with Sun SPOT using NetBeans 6.1Posted by brunogh on April 11, 2008 at 09:41 PM | Permalink | Comments (6)If you do not have a Sun SPOT (Figure 1), do not be bored, you can still have a lot of fun! In this entry, I gonna explain how to start programming the world using NetBeans 6.1! ![]() Figure 1: Sun SPOT rulez!!!
Downloading NetBeans IDE 6.11. Download NetBeans IDE 6.1 (RC1 launched today). A lot of new nice features, take a look in the New and Noteworthy and in the release page for a detailed list.
Installing Sun SPOT plugin2. Install Sun SPOT plugin into NetBeans. Download com-sun-sunspot-updatecenter.nbm. Now, in NetBeans, go to: 2.1 Tools menu -> Plugin. 2.2 Click on Downloaded tab. 2.3 Click on Add Plugins button and select the file. Then, confirm the installation clicking on Install button and accept the license agreement. 2.4 Finally, go to the Available Plugins tab, mark SunSPOTApplicationTemplate, SunSPOTHostApplicationTemplate and Sun SPOT Info, click on Install button and accept the license agreement. 2.5 You can check that everything is installed going to Installed tab (Figure 2). PS: David Simmons has blogged about these steps before. ![]() Figure 2: Installed tab.
Getting Sun SPOT SDK 3.0 Beta3. Get the Sun SPOT SDK 3.0 Beta emailing David Simmons, more details here. You will receive a link to download SPOTManager tool, that is a jar that installs the SDK and can run the emulator. Be sure you have at least JDK 1.5 and at least Ant 1.6.5 installed and configured in your system.
Creating the Demo Application4. Let's make the default demo application work. Go to: 4.1 File menu -> New Project 4.2 Select Java category, select Sun SPOT project and then click Next. 4.3 Leave the default project name and package and click Finish. 4.4 Open org.sunspotworld.StartApplication.java. You can see it extends MIDlet and already has some code. If you are familiar with Java ME, you will not have big problems. But, basically, Sun SPOT arquitecture is CLDC (Connected Limited Device Profile) 1.1 and has IMP (Information Module Profile) in the top - which can be defined as a MIDP (Mobile Information Device Profile) without UI stuff. Also, it has some additional libraries and all this runs in a VM called Squawk, that is characterized by being most written in Java. So, StartApplication implements the abstract methods inherited from the MIDlet (startApp,pauseApp that Squawk never calls and destroyApp). It works in a sand box enviromnent. The startApp code, in List 1, basically gets an object reference to the singleton eDemo Board and then make its LED blink red for a quarter of second each second. As you, can see, the code is pretty high level and easy to understand.
List 1: startApp code.
Running the Demo Application in the emulator5. Put this application to run in the emulator. 5.1 Right click the project and select Build. It will generate the jar in the /$PROJECT_HOME/suite/. If you have a spot device, you could send it directly by right clicking the project and selecting Build Project + Deploy to Sun SPOT , forgetting the next steps. 5.2 Open the emulator (in the ToolManager, go to Solarium tab and then click in the Solarium button). Then, in the emulator, click on the Emulator menu -> New virtual SPOT, you will notice that a Sun SPOT will appear in the squared right area. 5.3 Right click on the Sun SPOT picture, then click Specify application jar file... and select the application jar in /$PROJECT_HOME/suite/, which is the place that the application was built in step 5.1. 5.4 After that, click again on it, then Run MIDlet and StartApplication. Finally, you will see a red LED blinking!!! Wow! ![]() Figure 3: NetBeans 6.1, ToolManager, Emulator and the red LED blinking!
Where I go next?In NetBeans, check the Sun SPOT Info, that you have installed with the plugin, by clicking in the Window menu. David Simmons' Blog - http://blogs.sun.com/davidgs Roger Meike's Blog - http://blogs.sun.com/roger Sun SPOT Feeds (really nice aggregator with more cool blogs) - http://planets.sun.com/SunSPOT/group/SunSPOT Project Sun SPOT - https://www.sunspotworld.com Open source Sun SPOT - https://spots.dev.java.net (take a look in its subprojects as well). Search for spaughts in youtube.com or subscribe the tag feed directly. Recently, Aaron Houston has organized a conference call about Sun SPOT with Roger Meike and published the nice links we get during it in an email he sent. The links are available here too. Slides here. PS: I am using this entry for the NetBeans IDE 6.1 Beta Blogging Contest, take a look at http://www.netbeans.org/competition/blog-contest.html for more information about it. Go ahead, make an entry and have a chance to win $500! Good luck for us! ![]() Thanks! Have a nice weekend! Program the world! Bruno Ghisi Building a Java ME Bluetooth chat in 12 minutes...Posted by brunogh on April 02, 2008 at 08:05 PM | Permalink | Comments (0)As it was announced before, Marge 0.5 is out. In this post, I am going to demonstrate an interesting new feature called AutoConnect. AutoConnect is indeed to automatically connect Bluetooth devices. It has some limitations due to some bad implementations and has some scenarios that maybe it is not the best option, but still very interesting and is definitely awesome to make something with a few lines of code! For more information about the new release and this feature, please check http://wiki.java.net/bin/view/Mobileandembedded/HowTo05. So, nothing better than show a video... [sometimes I think I should have done cinema :) ]... Anyway, if you have not seen any Marge videos yet, try "Project Marge Interview", "My laptop is detecting my presence" and "Giant Blue Pong (my Bluetooth Atari)". Too much talk, take a look at the new "Building a Java ME Bluetooth chat in 12 minutes..." too. Could you not understand what happened in Netbeans code editor? Neither do I!!! It is better to download the full video (30MB). Hope you enjoy!
If you want more about Marge, go to http://marge.dev.java.net. If you want to help, please send an email to owner@marge.dev.java.net. We would love to hear suggestions and have you in our team! Go ahead! Marge your Bluetooth app! My First JRuby Bluetooth AppPosted by brunogh on January 31, 2008 at 06:54 PM | Permalink | Comments (6)TV, Coke and a laptop, it is time to have fun! We are always trying to integrate Marge (Java Bluetooth Framework) with other things. If you remember, in a last post, JavaFX Script was used, now it's time for JRuby! May you don't know, JRuby is Java implementation of the Ruby programming language. I am not a Ruby expert, but I hope I can become, because I am enjoying the language so much. Actually, I enrolled in a pretty interesting free online course by Satish Talim. If you enjoyed the content, be sure you join on March too! Here we go, no more delays! The basic idea of this post is to show a simple sample application that inquiry for Bluetooth devices, but more than just creating the application, be aware of thinking in the possibilities you can have with JRuby. What you will need:
Time to code!
Project Window:
Just insert your Bluetooth USB adapter press F6 to run!
My mobile was found! Before we finish, take a look in this nice effort to integrate Bluetooth/Ruby. The possibilities are endless...they are always endless... Cheers, Bruno Ghisi Developing OpenOffice.org Extensions in Java!Posted by brunogh on December 06, 2007 at 06:17 PM | Permalink | Comments (6)Hello guys! It's Friday! It's already December! What a great day to write about OpenOffice.org, which is lovely abbreviated as OOo. A lot of people have asked me about how mOOo Impress Controller was built. I am not too old yet - getting older this Sunday :) - but I have some stories to tell. In the begining of this year, I was at fisl 8.0 (International Free Software Forum)*, which is one of the biggest open source Latin America conferences and happens in the south of Brazil. If you like to talk about software, open source, Linux, culture, meet people, etc, etc, etc you should be there once! The 8th edition was definitely very special, I have met a lot of nice people, including people from Mobile & Embedded Community and Louis Suarez Potts. Please, froze this part, because we will get back here later, but now I have to start a new paragraph. As you can see, this post looks like that crazy movies that goes forward and reward, starts from the end... yeah, and this entry really starts from the end, if you have looked in the RSS description, I have written "You can develop extensions for your OpenOffice.org suite... with Java! Wow! There is a huge community around it, plugins to make your life easy, good documentation... so, what are you waiting for?!"... don't worry, we will get there. At that time of fisl 8.0, I had a very experimental demo running on Eclipse. The demo was made of two applications written in Java: a mobile (Java ME/MIDP) and a desktop (Java SE) one. The mobile was able to communicate, over Bluetooth, with the desktop side and the both used a XML protocol to interact. So, the mobile was able to navigate through the desktop file system, filtering for all the Impress OOo presentations that was being found. Also, the mobile was able to send a request to start a presentation file and after started, it was able to control the presentation, advancing and going back in the slides. It was something like that, but, as you guys know Murphy's Law, things are not always perfect and I can guarantee things get worse when you deal with demo applications. Anyway, the demo was not completely integrated with OOo, it was a just a demo invoking OOo Api. So, regarding what I have said in the last paragraph, I have met Louis and he was the guy that has gave the motivation to create a real OOo extension, after he has explained more about what was that, how Java would help that and son on. After the event, Lucas Torri and I have completely rewritten that demo as an Add-On extension, which later was called mOOo Impress Controller. So, we are now in the main part of this entry: you can easily create OOo extensions in Java. I said easily! There are plugins for Eclipse and for Netbeans IDE (help localizing it to your language). Basically, to put any of those plugins working, you just need to install an OOo SDK and also have an OOo suite or any other compatible installed, for example, StarOffice. Just be careful with the versions to keep things working fine. Get started now! Here it goes very useful links:
Go ahead! Make something that looks like your way! Automate any task that you always wanted in your suite! Make something different! Let me know!!! Have a great weekend! Bruno Ghisi * Call for Papers for fisl 9.0 are already open and goes until 20th of December. The event will be on April, 17-19 in Porto Alegre, Rio Grande do Sul, Brazil. What's coming in NetBeans Mobility Pack 6.0?Posted by brunogh on August 07, 2007 at 10:59 AM | Permalink | Comments (4)Hi all! I've downloaded Netbeans IDE 6.0 M10 - M10 is the last milestone for feature development - last weekend to take a new look in the Mobility Pack 6.0 that is coming. The Mobility Pack 6.0 will be now part of the Standard and Full version of Netbeans, you do not need to install it anymore, just if you get the Basic version. Netbeans 6.0 is planned to be available in the end of the year. So, let's talk about the news around Mobility Pack 6.0. We are definitely going to have a lot of improvements that will make ME developers even more happy! Some of things that I have noticed and tried:
For more around this fresh version, go to Mobility Milestones in Netbeans Wiki, there are detailed pages for each milestone, and VMD has its own page as well. Got curious? Download Netbeans 6.0 M10 and have a look yourself about what is coming (note that some things are still getting more stable)! Netbeans 6.0 will have a lot of other improvements, including in the code editor, which was one of the biggest complains about users of other IDEs. Great! Have a nice week! Thanks, Bruno Ghisi | ||
|
|