2011-02-09 23 views
1

我試圖使用我的三星Galaxy Tablet使用UUID "00001101-0000-1000-8000-00805F9B34FB"連接到帶有Socket SPP的藍牙,但這並不適用於我。當連接到三星Galaxy上的藍牙Socket SPP時,在Android 2.1中詢問「配對請求」

而且我使用以下嘗試:

Method m = device.getClass().getMethod("createRfcommSocket", new Class[] { int.class }); 
sock = (BluetoothSocket) m.invoke(device, Integer.valueOf(1)); 
sock.connect(); 

這是工作正常,但每次我嘗試連接,它要求配對請求PIN,那失敗是導致藍牙連接的故障。

如何設置/保存配對信息,以便每次連接時都不應提示配對請求。

+0

我與我的摩托羅拉DROID v1運行Android 2.2.1完全相同的問題。 http://stackoverflow.com/questions/3839795/prompted-for-bluetooth-pin-when-connecting-to-already-paired-device-on-android – JadeMason 2011-02-25 21:15:17

回答

1

您可以轉到Android設置菜單上的藍牙設置並將設備永久配對!你以前試過這個嗎?

2

我也遇到了這個問題。這可能是Android ICS問題。作爲一種解決方法,您可以使用不安全的套接字

Method m = device.getClass().getMethod("createInsecureRfcommSocket", new Class[] { int.class }); 
sock = (BluetoothSocket) m.invoke(device, Integer.valueOf(1)); 
sock.connect(); 
相關問題