tags:

views:

135

answers:

0

Hi,

I have some trouble finding out the friendly name of my mobile phone. Even the JavaMe emulator does not show it. Here is some code:

LocalDevice localDevice = LocalDevice.getLocalDevice();
DiscoveryAgent agent = localDevice.getDiscoveryAgent();
localDevice.setDiscoverable(DiscoveryAgent.GIAC);

String friendly = localDevice.getFriendlyName();

System.out.println("Hello, my address is "
  + LocalDevice.getLocalDevice().getBluetoothAddress()
  + " and my name is " + friendly);

As you can see in my output, the friendly name seems to be empty.

Hello, my address is 0123456789AF and my name is 

But if I set up a server, a RemoteDevice with the name emuName or something, can be found that provides the service.

What am I doing wrong here? Please help.