Skip to content

{ Monthly Archives } March 2008

J2ME: enumerating Bluetooth services whilst simultaneously getting the service name

On at least one device (a BlueSmirf), using the following construct in J2ME

agent.searchServices(new int[] {0×100}, new UUID[]{new UUID},dev, this);

will fail with an UNREACHABLE error code when searching for available Bluetooth services whilst also retrieving the service name  attribute (0×100).
Instead, what I had to do was use

agent.searchServices(null,new UUID[]{new UUID},dev, this);

And then once all services have been discovered [...]

Using StringItem as a placeholder in J2ME: OutOfMemory error on k750

I’ve been using the following:
stringItem = new StringItem(null,null, Item.PLAIN);
to indicate a placeholder for a string in a form on a J2ME application, debugged using the Wireless Toolkit emulator provided with NetBeans. This is perfectly valid w.r.t the stringitem API. 
 All was fine until deploying it onto an  actual device, namely a SE k750, where I was getting spurious OutOfMemory exceptions. Debugging and stepping through [...]