views:

501

answers:

1

Hi guys..
I've been searching high and low on this problem. Still can't find the solution. Basically, I want to transfer an encrypted file via OBEX Push Service (bluetooth) from client (j2me) to server (j2me). In emulator, it works fine. Client able to successfully do a bluetooth discovery lookup on the server.

But, when I put the application inside my phone. It doesn't show anything at all. I guess it might be a server or client url problem.

Can anyone help me.
Thx.
Simon

Here's some of my code (most probably is this that cause my problem).

(Client)
discoveryAgent.searchServices(null,new UUID[] { new UUID(1105) } , (RemoteDevice) list.getRemoteDevices().elementAt(i), this);

(Server)
sn = (SessionNotifier) Connector.open(btgoep://localhost:1105;name=ObexPushServer;authenticate=false;master=false;encrypt=false);

I tried replacing 1105 (in the server) with "00112233445566778899AABBCCDDEEFF", but still the same result.

A: 

The way you use UUID is incorrect. I am surprised it even works in emulator.

You need to create UUID like this,

UUID uuid = new UUID("1105", true);

and use the same uuid in searchServices and URL. For example,

String url = "btgoep://localhost:" + uuid + ";name=ObexPushServer;authenticate=false;master=false;encrypt=false";
ZZ Coder
Hi,Forget to mention, the UUID is what you have typed, I'm just basically converting the uuid into string for easier reference.Sorry. Anyway, it still unable to work.
simon sew