The Source for Java Technology Collaboration
User: Password:



Bruno Ghisi's Blog

Bruno Ghisi Bruno Ghisi is a Java enthusiast with focus on Java ME, open source and wireless technologies. He is a Mobile & Embedded Community Star and Java Champion. In addition, he helps a JUG called GUJava/SC and maintains some open source projects, such as Marge. He is a new grad that intends to do a Master and currently works for CERTI Foundation. Also, he lives in an island in the south of Brazil called Florianópolis.



Marging a FX Tetris at JavaOne!

Posted by brunogh on April 27, 2008 at 06:10 PM | Permalink | Comments (11)

Marge (Java Bluetooth Framework) got a mini talk in Community Corner. It will be on Wednesday at 3:30 pm. If are you interested in Bluetooth, JSR 82 (Java Apis for Bluetooth) and Marge, do not miss that! We have integrated a Bluetooth mobile controller for a nice James Weaver's compiled JavaFX Script tetris game! Thanks, Jim!

Here is a preview (updated):

The old video is at http://www.youtube.com/v/ZvVx6RGjCjM

It will be easy to find Marge:

margeinthebackpack.jpg

Here is the last tip, keep an eye on the Mobile and Embedded Wiki page for JavaOne!

I am very excited to meet new people! See you in San Francisco!

Bruno Ghisi



Pics from fisl 9.0

Posted by brunogh on April 22, 2008 at 09:40 AM | Permalink | Comments (0)

The 9th edition of fisl (International Free Software Forum) was huge! 7417 participants from 21 countries talking about open source 12 hours by day during 3 days. Wow! Great atmosphere! Great sessions! Great people! Great ideas, discussions, dinners...

Here are some pics that I got from my terrible camera:

1.JPG
Ale Gomes, from Mobile & Embedded, and Fabiane Nardon, JavaTools Community Leader.

2.JPG
Bruno Souza, Javali, Brazilian Sun Ambassadors, OpenSolaris User Group... did I forgot anyone?

3.JPG
Marge checking out a mobile session with her MSA compliant device!

4.JPG
Lucas Torri, Roger Brinkley and I. Sorry model agencies... no runways, we are busy....

5.JPG
What a nice guy!

6.JPG
Roger Brinkley, Mobile and Embedded Community leader, playing golf during his cool session!


Bluetooth about:

The slides of the session Marge, an open source framework for building Bluetooth applications in Java are available only in pt_BR (pdf and odf). mOOo Impress Controller was used to control the Impress presentation with the mobile and Giant Blue Pong was the demo showed in the end. Thanks for the audience, sorry if we had to hurry up. If you got any doubts, please send an email to us (mailing lists here).

During fisl, we have discovered a very nice thing! Bluecove, a JSR 82 Java SE implementation, is already working over BlueZ, the official Linux Bluetooth protocol stack. There is no release yet, but the snapshots we have tried are stable. Thanks to Vlad Skarzhevskyy, one of the project owners, that virtually helped us to put things working for our demo. Now you can have multiple connections in Linux, something that AvetanaBluetooth (open source) did not allow. Great news! Congrats to the Bluecove team! :)


Thanks,

Bruno Ghisi



Starting with Sun SPOT using NetBeans 6.1

Posted by brunogh on April 11, 2008 at 09:41 PM | Permalink | Comments (2)

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!



sun_spot2.jpg

Figure 1: Sun SPOT rulez!!!


Downloading NetBeans IDE 6.1


1. 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 plugin


2. 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.


netbeans_spot1.png
Figure 2: Installed tab.


Getting Sun SPOT SDK 3.0 Beta


3. 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 Application


4. 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.



protected void startApp() throws MIDletStateChangeException {
System.out.println("Hello, world");
new BootloaderListener().start(); // monitor the USB (if connected) and recognize commands from host

long ourAddr = Spot.getInstance().getRadioPolicyManager().getIEEEAddress();
System.out.println("Our radio address = " + IEEEAddress.toDottedHex(ourAddr));

ISwitch sw1 = EDemoBoard.getInstance().getSwitches()[EDemoBoard.SW1];
leds[0].setRGB(100,0,0); // set color to moderate red
while (sw1.isOpen()) { // done when switch is pressed
leds[0].setOn(); // Blink LED
Utils.sleep(250); // wait 1/4 seconds
leds[0].setOff();
Utils.sleep(1000); // wait 1 second
}
notifyDestroyed(); // cause the MIDlet to exit
}


List 1: startApp code.


Running the Demo Application in the emulator


5. 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!



netbeans_spot2.png

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!




61blog-contest-logo.gif




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!

marduke.png

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!



Palette Components in Visual Mobile Designer (Netbeans Mobility Pack)

Posted by brunogh on March 25, 2008 at 08:18 PM | Permalink | Comments (0)

Do you use Netbeans Mobility Pack? Do you always wanted to know more about all the palette components in Visual Mobile Designer (VMD)? I got an email from netbeans weekly (nbweekly@netbeans.org) with a very nice wiki page!

Original:

Visual Mobile Designer Palette Reference Page

Everything you wanted to know about the Visual Mobile Designer for mobile applications, but were afraid to ask is now revealed. This page gives a complete description of all the components in the VMD palette and includes links to related tutorials for each of the components where available. Get the information you need to make effective use of all the functionality the Mobility pack delivers!

VMD rulez! Enjoy it!

Bruno Ghisi



Anybody could explain me what is going on with Brazilian DTV?

Posted by brunogh on March 08, 2008 at 08:22 PM | Permalink | Comments (4)

Recently, I read Sun Microsystems And SBTVD Forum To Develop Open-Source Java Solution For Brazil's Digital TV System. Ok, looks like a nice news, but is there any reader that could explain me what is really going on?

I will try summarise my point of view, because I am not an expert on it. Brazilian open source middleware, called Ginga, is divided in two main parts: Ginga-ncl, which is uses a Brazilian scripting language called Lua (much used in embedded systems and games) and Ginga-j, which is supposed to be the Java stuff. As far as I know, Ginga-j is compatible with GEM (Globally Executable MHP) and it was having licenses and royalties problems. Also, it was being said that Ginga-j was open source, but things are not really clear, otherwise, probably, I would not being post this entry... how can you drive an open source project without clearity? Where can I download all the stuff? Where is the roadmap? So, Sun published that will help Forum do Sistema Brasileiro de TV Digital Terrestre (Forum SBTVD) to create a new plataform that will take place at Ginga. The announcement says that this platform will be compatible with Ginga, so is it a replacement for Ginga-j? How will be that?

Hope anybody could elucidate us.

Cheers,
Bruno Ghisi



My First JRuby Bluetooth App

Posted by brunogh on January 31, 2008 at 06:54 PM | Permalink | Comments (1)

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:
  • Download Netbeans IDE 6 (Select All package version, because it comes with Java and Ruby).
  • Get marge-core in Marge repository (you can use Netbeans to checkout from Subversion and generate a jar, because the last version is under development and was not launched yet, we are working on it :) ). Otherwise download the last launched version (0.4.0) and fix the inquiry method.
  • Get a JSR 82 implementation, I have used Avetana for Linux. I have explained it in another post, you can take a look here.

Time to code!
  1. Create a Ruby Project: File -> New Project -> Ruby -> Ruby Application. Click Next, configure your project (create a main.rb file and use a JRuby interpreter) and then click Finish.
  2. Add marge-core and Avetana. Right click in the project -> Properties -> Java and then add the jars in the JRuby classpath.
  3. Add the following code into main.rb. The code is pretty intuitive, because Ruby is! It basically imports some Marge classes (that are going to use Avetana internally), defines a listener that will be called during the inquiry and will print all the devices found. Also, the inquiry will be started by the singleton DeviceDiscoverer.

  4. 
    include Java
    
    include_class 'net.java.dev.marge.inquiry.DeviceDiscoverer'
    include_class 'net.java.dev.marge.inquiry.InquiryListener'
    
    puts 'Inquiring for Bluetooth Devices'
    discoverer = DeviceDiscoverer.instance;
    
    class InquiryListenerAppender 
        include InquiryListener
      def inquiryCompleted(remoteDevices)
        remoteDevices.each { |device| print "#{device.bluetooth_address} - #{device.get_friendly_name true} \n"  }
      end
      def inquiryError
        puts 'Inquiry Error'
      end
      def deviceDiscovered(device,deviceClass)
      end
    end
    
    discoverer.start_inquiry_giac InquiryListenerAppender.new
    

Project Window:
btjruby_1.png

Just insert your Bluetooth USB adapter press F6 to run!
btjruby_2.png

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

April 2008
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      


Search this blog:
  

Categories
Community: Java Communications
Community: Java Tools
Community: Java User Groups
Community: JavaDesktop
Community: Mobile & Embedded
Community: NetBeans
J2SE
JavaOne
Mobility
Open Source
Tools
Archives

April 2008
March 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007

Recent Entries

Marging a FX Tetris at JavaOne!

Pics from fisl 9.0

Starting with Sun SPOT using NetBeans 6.1



Powered by
Movable Type 3.01D


 Feed java.net RSS Feeds