Using backport-android-bluetooth on Android 1.6
Posted
by newth
on Stack Overflow
See other posts from Stack Overflow
or by newth
Published on 2010-03-24T08:50:53Z
Indexed on
2010/03/24
8:53 UTC
Read the original article
Hit count: 1056
Hi,
I'm trying to write an application using Bluetooth on Android 1.6. Since it's not officially supported, I found the backport of android.bluetooth API ( http://code.google.com/p/backport-android-bluetooth ). But when I deploy the sample chat application (modified for backport) LogCat gives me the error below:
My question is, how I can use backport-android-bluetooth on 1.6 and is there any working samples?
Thanks!
11-30 14:03:19.890: ERROR/AndroidRuntime(1927): Uncaught handler: thread main exiting due to uncaught exception
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): java.lang.ExceptionInInitializerError
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at backport.android.bluetooth.BluetoothSocket.<init>(BluetoothSocket.java:69)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at backport.android.bluetooth.BluetoothServerSocket.<init>(BluetoothServerSocket.java:16)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at backport.android.bluetooth.BluetoothAdapter.listenUsingRfcommWithServiceRecord(BluetoothAdapter.java:513)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at com.example.bluetooth.BluetoothChatService$AcceptThread.<init>(BluetoothChatService.java:237)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at com.example.bluetooth.BluetoothChatService.start(BluetoothChatService.java:109)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at com.example.bluetooth.BluetoothChat.onResume(BluetoothChat.java:138)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1225)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at android.app.Activity.performResume(Activity.java:3559)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2838)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2866)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2420)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at android.app.ActivityThread.access$2100(ActivityThread.java:116)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at android.os.Handler.dispatchMessage(Handler.java:99)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at android.os.Looper.loop(Looper.java:123)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at android.app.ActivityThread.main(ActivityThread.java:4203)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at java.lang.reflect.Method.invokeNative(Native Method)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at java.lang.reflect.Method.invoke(Method.java:521)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at dalvik.system.NativeStart.main(Native Method)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): Caused by: java.lang.UnsatisfiedLinkError: classInitNative
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at android.bluetooth.RfcommSocket.classInitNative(Native Method)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): at android.bluetooth.RfcommSocket.<clinit>(RfcommSocket.java:152)
11-30 14:03:19.906: ERROR/AndroidRuntime(1927): ... 21 more
© Stack Overflow or respective owner