My app is a modified version of the Bluetooth Chat example. It uses SPP for one thing and it is uni-directional communication, which is to say that it does not listen on the Input stream. It throws an IO Exception consistently about 40 seconds after making the connection, as shown in the following Log output:
02-01 21:46:17.288: INFO/BluetoothService(2487): BEGIN mConnectedThread 02-01 21:46:57.078: ERROR/BluetoothService(2487): Exception during write 02-01 21:46:57.078: ERROR/BluetoothService(2487): java.io.IOException: Connection timed out 02-01 21:46:57.078: ERROR/BluetoothService(2487): at android.bluetooth.BluetoothSocket.writeNative(Native Method) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at android.bluetooth.BluetoothSocket.write(BluetoothSocket.java:317) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at android.bluetooth.BluetoothOutputStream.write (BluetoothOutputStream.java:85) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at java.io.OutputStream.write(OutputStream.java:82) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at com.thegadgetworks.automate.BluetoothService$ConnectedThread.write (BluetoothService.java:428) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at com.thegadgetworks.automate.BluetoothService.write (BluetoothService.java:199) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at com.thegadgetworks.automate.AutoMate.sendMessage(AutoMate.java:244) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at com.thegadgetworks.automate.AutoMate.access$0(AutoMate.java:233) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at com.thegadgetworks.automate.AutoMate$5.onClick(AutoMate.java:188) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at android.view.View.performClick(View.java:2364) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at android.view.View.onTouchEvent(View.java:4179) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at android.widget.TextView.onTouchEvent(TextView.java:6540) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at android.view.View.dispatchTouchEvent(View.java:3709) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at com.android.internal.policy.impl.PhoneWindow $DecorView.superDispatchTouchEvent(PhoneWindow.java:1659) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent (PhoneWindow.java:1107) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at android.app.Activity.dispatchTouchEvent(Activity.java:2061) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at com.android.internal.policy.impl.PhoneWindow $DecorView.dispatchTouchEvent(PhoneWindow.java:1643) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at android.os.Handler.dispatchMessage(Handler.java:99) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at android.os.Looper.loop(Looper.java:123) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at android.app.ActivityThread.main(ActivityThread.java:4363) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at java.lang.reflect.Method.invokeNative(Native Method) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at java.lang.reflect.Method.invoke(Method.java:521) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:860) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 02-01 21:46:57.078: ERROR/BluetoothService(2487): at dalvik.system.NativeStart.main(Native Method) Any idea how to get around this problem? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en