Hi all...
I'm working in my graduation project using J2ME
it's about Talk via bluetooth
capture audio work well.
device discovery work well.
send a test message work well in NetBeans emulator
BUT..
when I run it in a mobile it is not received anythink.
I'm using IBM package
Plz I need any help
/*
* This code discover devices & send/receive message
* Hudhiafa Shatnawi / Jordan / AABU / CS
*/
public class Millcovery
extends MIDlet
implements CommandListener, BTEventListener {
public Millcovery() {
...
manager = new BTManager();
manager.addBTEventListener( this );
...
} // END: Millcovery constructor
public void commandAction( Command theCommand, Displayable theDisplay ) {
if ( theCommand.getLabel().equals( "Discover Devices" ) ) {
...
manager.searchForDevices();
deviceCache = manager.getDevices();
...
} else if ( theCommand.getLabel().equals( "Call" ) ) {
selectedDevice = discovered.getSelectedIndex();
...
try {
RemoteDevice remoteDevice = deviceCache[ selectedDevice ];
manager.sendMessage( ( RemoteDevice ) deviceCache[ selectedDevice ], LocalDevice.getLocalDevice().getFriendlyName() + "\ncall you!" );
} catch (...) {}
...
} // END: if..else
} // END: commandAction
public void messageReceived( BTEvent event ) { // Print received message < event.getSource() > }
public void messageSent( BTEvent event ) { // Print sent message < event.getSource() > }
public void devicesDiscovered( BTEvent event ) { // Show discovred devices }
public void diagnosticMessage( BTEvent event ) { // Print diagnostic message < event.getSource() > }
public void errorMessage( BTEvent event ) { // Print error message < event.getSource() > }
public void alert( String m, Screen nextScreen ) { // Promt alert }
protected Display display;
protected BTManager manager; // It is a class from IBM package
protected RemoteDevice[] deviceCache;
protected DiscoveredDevice discovered; // It is a class extends List
} // END: class Millcovery
Plz I need any help quikly...

Reply With Quote


