Bluetooth not sending file to other device

前端 未结 4 1432
深忆病人
深忆病人 2021-02-14 12:41

It is already asked but i didn\'t find any solution. For bluetooth application i am using the bluetoothShare.class .

My source code for sending the file to

4条回答
  •  不要未来只要你来
    2021-02-14 13:11

    Maybe this could help you in some way…

    private void sendData(String message) {
        byte[] msgBuffer = message.getBytes();
        Log.d(TAG, "...Sending data: " + message + "...");
        try {
            outStream.write(msgBuffer);
        } catch (IOException e) {
            String msg = "In onResume() and an exception occurred during write: " + e.getMessage();
            if (address.equals("00:00:00:00:00:00")) 
                msg = msg + ".\n\nUpdate your server address from 00:00:00:00:00:00 to the correct address on java code";
            msg = msg +  ".\n\nCheck that the SPP UUID: " + MY_UUID.toString() + " exists on server.\n\n";
            errorExit("Fatal Error", msg);       
        }
    }
    

提交回复
热议问题