Open GoogleCodeExporter opened 8 years ago
Ok, I did some tests and phones don't pair with the app.
When they are paired before from settings, bluetooth chat just crashes.
This is the error:
E/AndroidRuntime( 500): Uncaught handler: thread main exiting due to uncaught
exception
E/AndroidRuntime( 500): java.lang.RuntimeException: Unable to start activity
ComponentInfo{backport.android.bluetooth/com.example.bluetooth.DeviceListActivit
y}:
java.lang.IllegalArgumentException: 00:24:BA:B2:EF:3C,<unknown>,6816268 is not a
valid Bluetooth address
E/AndroidRuntime( 500): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)
E/AndroidRuntime( 500): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
E/AndroidRuntime( 500): at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
E/AndroidRuntime( 500): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
E/AndroidRuntime( 500): at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 500): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 500): at
android.app.ActivityThread.main(ActivityThread.java:3948)
E/AndroidRuntime( 500): at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 500): at
java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 500): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
E/AndroidRuntime( 500): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
E/AndroidRuntime( 500): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 500): Caused by: java.lang.IllegalArgumentException:
00:24:BA:B2:EF:3C,<unknown>,6816268 is not a valid Bluetooth address
E/AndroidRuntime( 500): at
backport.android.bluetooth.BluetoothDevice.<init>(BluetoothDevice.java:372)
E/AndroidRuntime( 500): at
backport.android.bluetooth.BluetoothAdapter.getBondedDevices(BluetoothAdapter.ja
va:367)
E/AndroidRuntime( 500): at
com.example.bluetooth.DeviceListActivity.onCreate(DeviceListActivity.java:107)
E/AndroidRuntime( 500): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1132)
E/AndroidRuntime( 500): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
E/AndroidRuntime( 500): ... 11 more
Original comment by victor.n...@gmail.com
on 29 Apr 2010 at 12:57
"java.lang.IllegalArgumentException: 00:24:BA:B2:EF:3C,<unknown>,6816268 is not
a"
It is that line... the thing is that a device is initiated only with MAC
address... so change the lines 366-367 in the BluetoothAdapter.java to:
String address = bonds[i];
address=address.substring(0, address.indexOf(','));
devices.add(new BluetoothDevice(address));
... Then you have to rebuilt the lib. but I don't know how to do this so I
haven't tested it (is should work though)
Original comment by bodozog...@gmail.com
on 8 Jun 2010 at 4:08
Yes this is the problem. My FIx:
String[] toks = bonds[i].split(",");
String address = toks[0];
devices.add(new BluetoothDevice(address));
However, next problem is:
V/BluetoothDeviceService.cpp( 81): getRemoteNameNative
I/bluetooth_common.cpp( 81): com.ti.btips, /com/ti/btips, com.ti.btips.bmg,
GetRemoteDeviceName
I/MyApp (12739): Exception in getBondedDevices java.lang.NullPointerException
Any suggestions?
Original comment by olub...@gmail.com
on 2 Jul 2010 at 1:22
Original issue reported on code.google.com by
victor.n...@gmail.com
on 29 Apr 2010 at 12:13Attachments: