Hi, I have an j2me application that is working fine with most of the Symbian platforms except the 9.4 version. Application makes use of bluetooth connections and PushRegistry in order to be started and receive data. Application uses the next piece of code to register for a bluetooth connection and push:
and the next piece iof code to obtain the connection:Code:String url = null; String activeConn[] = PushRegistry.listConnections(true); for (int i = 0; i < activeConn.length; i++) { if (-1 < activeConn[i].indexOf("btspp")) { url = activeConn[i]; break; } } if (null == url) { url = "btspp://:102030405060708090A1B1C1D1D1E100;name=My%20OBEX"; String regConns[] = PushRegistry.listConnections(false); int i = 0; for (; null != regConns && i < regConns.length; i++) { if (url.equals(regConns[i])) { // already registered break; } } if (regConns.length == i) { try { PushRegistry.registerConnection(url, MidletJSR82.class.getName(), "*"); } catch (Exception e) { url = "btspp://localhost:102030405060708090A1B1C1D1D1E100;name=My OBEX"; e.printStackTrace(); } } } while (null == service) { try { LocalDevice.getLocalDevice().setDiscoverable(DiscoveryAgent.GIAC); service = (StreamConnectionNotifier) Connector.open(url); } catch (Exception e) { service = null; System.out.println("Error! Bluetooth is unavailable."); try { Thread.sleep(5 * 1000); } catch (InterruptedException ire) { } } }
Connection is also registered in the jad file:Code:System.out.println("RfComm openStreamConnection"); StreamConnection c = service.acceptAndOpen(); System.out.println("finished RfComm openStreamConnection");
MIDlet-Push-1: btspp://:102030405060708090A1B1C1D1D1E100;name=My OBEX, com.MidletJSR82, *
The program works fine during initial OTA install. Then after first restart of the phone everything works fine.
then on the second phone restart we have exactly one application start so that bluetooth data is being received. After that the pairing is lost and there is no way to restore it other then to reinstall the app. Icn provide any other code need.
Any suggestion on why this might be happening?

Reply With Quote
. Can anyone give some advice/info on how this is supposed to work? Adding localhost to the JAD's Midlet-Push-1 doesn't change anything.
.


