Giter VIP home page Giter VIP logo

Comments (13)

xiaomochn avatar xiaomochn commented on July 16, 2024 2

in class app.akexorcist.bluetotohspp.library.BluetoothSPP line 371 when arr_name.size()==0 a arr ArrayIndexOutOfBoundsException occured

from bluetoothspplibrary.

vicctor avatar vicctor commented on July 16, 2024 2

I noticed this same problem in case if I will switch off the BT in my phone during connection.

from bluetoothspplibrary.

jtoros13 avatar jtoros13 commented on July 16, 2024 2

What about that "AcceptThread" null reference mentioned in the very first message?
Do you plan to fix it?
This causes great inconvenience to our company, so if you have stalled the project, plz let me know to use another package

from bluetoothspplibrary.

akexorcist avatar akexorcist commented on July 16, 2024

Thanks!

from bluetoothspplibrary.

eraare avatar eraare commented on July 16, 2024

I set the Listener, but received nothing. Follow is the codes:
bt.setOnDataReceivedListener(new BluetoothSPP.OnDataReceivedListener() {
@OverRide
public void onDataReceived(byte[] data, String message) {
System.out.println("APP:received-" /+ message/);
}
});
Need your help, thanks

from bluetoothspplibrary.

waro163 avatar waro163 commented on July 16, 2024

i have the same problem as r00kie0, setting the bluetooth data listener, but i can not receive
anything, i need your help. thanks.

from bluetoothspplibrary.

ali4fun avatar ali4fun commented on July 16, 2024

onDataReceived(byte[] data, String message)
NOT working here.. same problem.. plz give solution

from bluetoothspplibrary.

jaime1990 avatar jaime1990 commented on July 16, 2024

The function of onDataReceived not work, plz give solution. tks~

from bluetoothspplibrary.

matheuslf avatar matheuslf commented on July 16, 2024

Hello Guys,

To receive messages correctly the text should have a 0x0A and 0x0D at the end. Like you can see in this code:

// Keep listening to the InputStream while connected
            while (true) {
                try {
                    int data = mmInStream.read();
                    if(data == 0x0A) {

                    } else if(data == 0x0D) {
                        buffer = new byte[arr_byte.size()];
                        for(int i = 0 ; i < arr_byte.size() ; i++) {
                            buffer[i] = arr_byte.get(i).byteValue();
                        }
                        // Send the obtained bytes to the UI Activity
                        mHandler.obtainMessage(BluetoothState.MESSAGE_READ
                                , buffer.length, -1, buffer).sendToTarget();
                        arr_byte = new ArrayList<Integer>();
                    } else {
                        arr_byte.add(data);
                    }
                } catch (IOException e) {
                    connectionLost();
                    // Start the service over to restart listening mode
                    BluetoothService.this.start(BluetoothService.this.isAndroid);
                    break;
                }
            }

from bluetoothspplibrary.

stkq avatar stkq commented on July 16, 2024

jtoros13 did you find a solution? I'm getting the same problem and I don't have access to the phone in question.

from bluetoothspplibrary.

jtoros13 avatar jtoros13 commented on July 16, 2024

Nope, no "out of the box" solution found.
I downloaded the code in my project as a different package, and after adding it as external reference, I changed the code itself.

Hope this helps
jtoros13

from bluetoothspplibrary.

garispe avatar garispe commented on July 16, 2024

@akexorcist
First of all, thank you for your work in this project.

Sorry for my english, I'm from Argentina. As mentioned in some comments, I need to know if it is going to solve the "AcceptThread" bug, because I have a project to finish and one of the things that slow me down is this bug.

from bluetoothspplibrary.

aq62386238 avatar aq62386238 commented on July 16, 2024

sorry i got this problem how to slove
"Unsupported method: BaseConfig.getApplicationIdSuffix().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model."

from bluetoothspplibrary.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.