I managed to find some ServiceRecords phone when using:
UUID[] uuidSet = new UUID[1]; uuidSet[0]=new UUID(0x0100); int[] attrIds = { 0x0100 }; System.out.println("\nSearching for service..."); agent.searchServices(attrIds, uuidSet, remoteDevice, client);
And you call lock.notify () twice after serviceSearch, delete it in the servicesDiscovered function.
You should also look at the service records and look for the one you are interested in. The URL indicates btgoep: // or btspp: //
When searching for a for loop, use this code to display the service name
for(int i = 0; i < servRecord.length; i++) { String url = servRecord[i].getConnectionURL(ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false); DataElement serviceName = srs[i].getAttributeValue(0x0100); if (serviceName != null) { System.out.println("service " + serviceName.getValue() + " found " + url); } else { System.out.println("service found " + url); }
I have an exact problem, it looks like the android api is not registering ServiceRecord with SDP, so the Bluicove api can find it. No matter which UUID I use, it will find only those that my phone registers by default, I e Audio gateways and Telnet OBEX push, etc.
EDIT --- I had the same problem, but I realized that in fact I have not yet called listenUsingInsecureRFCOMMSocket. And then he did not register the service record. But after that, everything turned out fine.
source share