Closed GoogleCodeExporter closed 8 years ago
I'm sorry. My mistake. I didn't realize that I need to set the pin in
pinRequested().
If someone else has this problem, the solution is to set the pin in the
RemoteBluetoothDeviceListener in the event: pinRequested. (Read about this
event in
java doc - it's really clear)
Original comment by eran.kir...@gmail.com
on 6 Oct 2009 at 11:30
Original comment by gerda...@gmail.com
on 18 Oct 2009 at 7:02
Hello,
I'm also having problems with this issue. I try to open a BluetoothSocket to another
device, and when I try to do this, I received the pinRequested event. At this
point I
do remoteDevice.setPin("0000");. What is the next step? If I try to open the
socket
again it throws an exception, and I don´t receive the paired event.
Thanks.
Original comment by fquinhoy...@gmail.com
on 19 Oct 2009 at 3:32
Hi,
Same thing is here also. I am using following code as mentioned in the doc. But
the pinRequested() method has been never called up. Any help or clue would be
appreciated. If there is any other way to set PIN please respond.
----------------------------------------------------------------------
private class RemoteBluetoothDeviceEventHandler implements
RemoteBluetoothDeviceListener {
RemoteBluetoothDevice device ;
public void paired() {
try {
if (D) Log.i(TAG, "BS paired 1.");
mmSocket = device.openSocket(1);
} catch (BluetoothException e) {
if (D) Log.i(TAG, "BS paired() BluetoothException.");
e.printStackTrace();
connectionFailed();
}
}
public void pinRequested() {
if (D) Log.i(TAG, "pinRequested()*************************");
try {
device.setPin("1234");
} catch (BluetoothException e) {
e.printStackTrace();
}
}
public void gotServiceChannel(int serviceID, int channel) {
if (D) Log.i(TAG, "gotServiceChannel()");
}
public void serviceChannelNotAvailable(int serviceID) {
if (D) Log.i(TAG, "serviceChannelNotAvailable()");
}
}
----------------------------------------------------------------------
Thanx & Regds.
Original comment by santosh....@gmail.com
on 30 Jun 2010 at 7:44
In android standard API, i have never seen setPin() method.
Which version of android sdk do you using?
I checked
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/and
roid/2.1_r2/android/bluetooth/BluetoothDevice.java#BluetoothDevice.setPin%28byte
%5B%5D%29
I downloaded android-2.2.1_r1.jar.
But i did not found the way how can i use the .jar file. Because the name space
of the library is same with android standard api.
Please help me.
Original comment by ycm825@gmail.com
on 21 May 2012 at 8:50
Original issue reported on code.google.com by
eran.kir...@gmail.com
on 6 Oct 2009 at 9:33