Samsung Galaxy bluetooth drivers

后端 未结 2 1190
有刺的猬
有刺的猬 2020-12-29 16:55

I have written an application for Android. the main part being that it communicates via bluetooth. I have four devices:
1. Samsung Galaxy S2
2. Samsung Galaxy Gio

相关标签:
2条回答
  • 2020-12-29 17:28

    In my app i have bluetooth, working on stock galaxy S (both 1 and 2), Nexus One, HTC Desire, asus tablet and some other device. My app is from android 2.1, and i have this reflaction in my code (with the SDK, it somtimes failed for uknown reason to me, with the "Service discovery failed" error message) that fixed the error:

    BluetoothSocket mSocket = null;
    mBluetoothAdapter.cancelDiscovery();
    
    Method method;
    try {
                method = mBluetoothDevice.getClass().getMethod("createRfcommSocket", new Class[] {int.class});
                mSocket = (BluetoothSocket) method.invoke(mBluetoothDevice,1);
        } catch (NoSuchMethodException e1) {
                e1.printStackTrace();
        } catch (IllegalArgumentException e) {
                e.printStackTrace();
        } catch (IllegalAccessException e) {
                e.printStackTrace();
        } catch (InvocationTargetException e) {
                e.printStackTrace();
        }
    
    mSocket.connect();
    

    but other then that, i use the sdk, and everything works.

    0 讨论(0)
  • 2020-12-29 17:34

    The problem is, that newer Samsung devices (and HTC sense devices) don't have the full Bluetooth stack.

    That is why for example apps like this one don't work on these devices either. The only solution would be to flash a full Bluetooth stack, eg by flashing a Cyanogenmod Rom.

    0 讨论(0)
提交回复
热议问题