connectionstring format :btspp://localhost:" + uuid(Universally unique identifier) + ";authenticate=false;encrypt=false;name="+servicename (Service name you want to give to your service) /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package bluetoothcore; import bluetoothcore_interface.AsynchronousResponseHandler; import bluetoothcore_interface.AsynchronousRequestHandler; import de.enough.polish.util.ArrayList; import javax.microedition.io.Connection; import javax.microedition.io.Connector; import javax.microedition.io.StreamConnection; import javax.microedition.io.StreamConnectionNotifier; import javax.microedition.lcdui.Display; import utils.utility; import main.FriendFinder; /** * * @author dhanendra */ public class FriendServer extends Thread { Connection connection; String conString; private StreamConnectionNotifier streamConnNotifier; public FriendServer(String connectionString) { super(); this.ffinder=fmain; this.hdl=h; this.conString=connectionString; this.start(); } public void run() { initServer(conString); } private void initServer(String connectionString) { try { this.streamConnNotifier = (StreamConnectionNotifier) Connector.open(connectionString); while(true) { // utility.showMessage(Display.getDisplay(ffinder), "opened successfully"); // utility.showMessage(Display.getDisplay(ffinder), "connected successfully"); this.connection = streamConnNotifier.acceptAndOpen(); } } catch (Exception ex) { } } }
![]() My Blog Title
|