通过蓝牙将文件从手机传输到另一部手机
我一直在寻找这个问题。仍然找不到解决办法。 基本上,我想通过 OBEX 推送服务(蓝牙)从客户端(j2me)将加密文件传输到服务器(j2me)。在模拟器中,它工作正常。客户端能够在服务器上成功执行蓝牙发现查找。
但是,当我将应用程序放入手机中时。它根本没有显示任何东西。我猜这可能是服务器或客户端 url 问题。
谁能帮助我吗?
这是我的一些代码(很可能是这导致了我的问题)。
(客户端)
discoveryAgent.searchServices(null,new UUID[] { new UUID(1105) },
(RemoteDevice) list.getRemoteDevices().elementAt(i), this);
(服务器)
sn = (SessionNotifier) Connector.open(
"btgoep://localhost:1105;name=ObexPushServer;authenticate=false;master=false;encrypt=false");
我尝试用“001122333445566778899AABBCCDDEEFF”替换1105(在服务器中),但结果仍然相同。
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?
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您使用 UUID 的方式不正确。我很惊讶它甚至可以在模拟器中运行。
您需要像这样创建 UUID,
并在 searchServices 和 URL 中使用相同的 uuid。例如,
The way you use UUID is incorrect. I am surprised it even works in emulator.
You need to create UUID like this,
and use the same uuid in searchServices and URL. For example,