![](/img/trans.png)
[英]how can i transfer image from PC to Mobile via bluetooth using RFCOMM in java?
[英]transfer file from mobile phone to another via bluetooth
我一直在尋找這個問題的重點。 仍然找不到解決方案。 基本上,我想通過OBEX推送服務(藍牙)將加密的文件從客戶端(j2me)傳輸到服務器(j2me)。 在模擬器中,它可以正常工作。 客戶端能夠在服務器上成功進行藍牙發現查找。
但是,當我將應用程序放入手機中時。 它什么也沒顯示。 我猜可能是服務器或客戶端的網址問題。
誰能幫我?
下面是一些我的代碼(最有可能是這個引起我的問題)。
(客戶)
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");
我嘗試用“ 00112233445566778899AABBCCDDEEFF”替換服務器中的1105,但結果仍然相同。
您使用UUID的方式不正確。 我很驚訝它甚至可以在仿真器中工作。
您需要像這樣創建UUID,
UUID uuid = new UUID("1105", true);
並在searchServices和URL中使用相同的uuid。 例如,
String url = "btgoep://localhost:" + uuid + ";name=ObexPushServer;authenticate=false;master=false;encrypt=false";
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.