Wednesday, May 13, 2009

an introduction to bluetooth API's using JAVA

Just started with some serious work on my FYP and this is a really interesting article on getting started with bluetooth communication in JAVA ME application.

http://developers.sun.com/mobility/apis/articles/bluetooth_gps/part1/

Now, the article talks generally about creating a JAVA ME program without the use of an IDE so it was a bit of a work around to get the thing to work using Netbeans. So here are some additional notes.

1. The mpowerplayer sdk comes with a tutorial folder. I would recommend reading this page /tutorial/index.html

2. You need to make a few changes to the manifest file in order to make the application work. In order to change the manifest file using Netbeans (manually changing it in the project files will not work as soon as you hit build again). Right click on the project and then add the Midlet name in the application descriptor (refer to image). This adds a midlet-1 tag to your manifest file. Just make sure that the name of the midlet corresponds to your specific midlet name.

Another error you might encounter is that a DiscoveryListener was not found. There is a slight mistake in the article, it asks you to put the avetanaBluetooth jar file in the bluetooth folder. Place it in the root folder where all the other jar files are and you should get around this pretty smoothly.

So thats about it. I am a newbie to this technology so hopefully this article helped.

Cheers
Sparsh