I've got some bluetooth code that is behaving strangely. When any class method is called on a javax.bluetooth.ServiceRecord object, the code execution stops.
And when it fails it does not throw an exception (I've put it in a try-catch) and it does not in any other way indicate that there has been an application error. It's as if the method call gets executed as if it was just a 'return' statement.
Debug lines following it are not executed and neither is the catch code. No 'application error' pop up is presented like i've seen before with uncaught exceptions.
I'm at a complete loss.
Where do the stdout and stderr messages go on a nokia phone (the app behaves the same on a 6600 and 7610)? Is there some log somewhere that I should be checking to find out what goes wrong?
I'm new to J2ME but in J2SE I would try to catch a Throwable object instead of a normal Exception. Throwable is the common ascestor of Exception and Error classes. It is usually not a good idea to catch Errors, but if that's what's happening you will have a clue about the problem.
Doh, that never occurred to me! You're so right, after changing to Throwable, I got this output:
I've modified my code to work against any RemoteDevice instead of just the GPS unit. When scanning for services against other devices (such as my powerbook, using UUID 0008) the exact same thing happens: I can get a ServiceRevord but trying to call methods on it gives this error.
Is there something wrong with the ServiceRecord class installed on these Nokias?