Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Bluetooth, J2ME Wireless Toolkit 2.2

807607Jan 24 2007 — edited Jan 24 2007
Hey all,

I want to be able to create a little device discovery program using the onboard bluetooth on my xp laptop to find my bluetooth mobile phone. I have downloaded the J2ME Wireless Toolkit and added jsr082.jar and midpapi10.jar to my project.

My question is how do you do the stack initialization for this SDK? I have found the following code for Atinav Java Bluetooth SDK (taken from http://today.java.net/lpt/a/112):
import javax.bluetooth.*;
import javax.microedition.io.*;
import com.atinav.BCC;

public class WirelessDevice implements DiscoveryListener {
    LocalDevice localDevice = null; 
    
    public WirelessDevice (){ 
        //setting the port number using Atinav's BCC
        BCC.setPortName("COM1"); 
        
        //setting the baud rate using Atinav's BCC
        BCC.setBaudRate(57600);
        
        //connectable mode using Atinav's BCC
        BCC.setConnectable(true);
        
        //Set discoverable mode using Atinav's BCC 
        BCC.setDiscoverable(DiscoveryAgent.GIAC); 
        
        try{
            localDevice = LocalDevice.getLoaclDevice(); 
        }
        catch (BluetoothStateException exp) {
        }
        
        // implementation of methods in DiscoveryListener class
        // of javax.bluetooth goes here
        
        // now do some work
    }
}
I can't find the quivalent of what the code does for my SDK. Does anyone know where I can find it or any more relevant tutorials?

Thanks in advance.

Comments

807607
http://www.googleityoumoron.com/?go=j2me+bluetooth (thanks to ted_trippin)

Message was edited by:
supareno
807607
Thanks for the quick reply Supareno!

I've already used Google and managed to find a lot of information on both 'J2ME' and 'Bluetooth' keywords, but I have not been able to answer my question. Maybe I am looking for the wrong thing or maybe I don't understand bluetooth and the stack initialization process so I'm searching for the wrong stuff. Either way, I'm posting on a forum for help and your post is not helpful for me and definately not helpful for anyone else who wants to know the answer.

Can anyone else help me please? (Even if you've used a different SDK)
1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Feb 21 2007
Added on Jan 24 2007
2 comments
275 views