Comment lire les données du scanner de codes à barres bluetooth Symbole CS3070 à Android Device

Dans mon projet, je dois lire des codes-barres à l'aide de scanner de code à barres Symbole CS3070 par le biais de bluetooth. j'.e; j'ai pour établir une connexion entre l'appareil android et le scanner de code-barres grâce à la technologie bluetooth. Quelqu'un peut-il me dire comment faire pour lire des valeurs de lecteur de code à barres et comment le programme d'installation pour la communication? J'ai déjà lu les Bluetooth Guide Du Développeuret je ne veux pas utiliser de Lecteur de code à Barres de Clavier de Bluetooth de l'Émulation (HID) mode (j'ai quelques textview qui peut être rempli à l'aide du clavier virtuel et Lecteur de code-Barres et je ne peux pas le contrôle a le focus)

J'avais utiliser un thread comme celui-ci de communiquer avec un lecteur de

    private class BarcodeReaderThread extends Thread {
private final BluetoothServerSocket mmServerSocket;
public BarcodeReaderThread(UUID UUID_BLUETOOTH) {
//Use a temporary object that is later assigned to mmServerSocket,
//because mmServerSocket is final
BluetoothServerSocket tmp = null;
try {
//MY_UUID is the app's UUID string, also used by the client code
tmp = mBluetoothAdapter.listenUsingRfcommWithServiceRecord("BarcodeScannerForSGST", UUID_BLUETOOTH);
/*
* The UUID is also included in the SDP entry and will be the basis for the connection
* agreement with the client device. That is, when the client attempts to connect with this device,
* it will carry a UUID that uniquely identifies the service with which it wants to connect.
* These UUIDs must match in order for the connection to be accepted (in the next step)
*/
} catch (IOException e) { }
mmServerSocket = tmp;
}
public void run() {
BluetoothSocket socket = null;
//Keep listening until exception occurs or a socket is returned
while (true) {
try {
socket = mmServerSocket.accept();
try {
//If a connection was accepted
if (socket != null) {
//Do work to manage the connection (in a separate thread)
InputStream mmInStream = null;
//Get the input and output streams, using temp objects because
//member streams are final
mmInStream = socket.getInputStream();
byte[] buffer = new byte[1024];  //buffer store for the stream
int bytes; //bytes returned from read()
//Keep listening to the InputStream until an exception occurs
//Read from the InputStream
bytes = mmInStream.read(buffer);
if (bytes > 0) {
//Send the obtained bytes to the UI activity
String readMessage = new String(buffer, 0, bytes);
//doMainUIOp(BARCODE_READ, readMessage);
if (readMessage.length() > 0 && !etMlfb.isEnabled()) //Se sono nella parte di picking
new ServerWorker().execute(new Object[] {LEGGI_SPED, readMessage});
}
socket.close();
}
}
catch (Exception ex) { } 
} catch (IOException e) {
break;
}
}
}
/** 
* Will cancel the listening socket, and cause the thread to finish
*/
public void cancel() {
try {
mmServerSocket.close();
} catch (IOException e) { }
}
}

Grâce

source d'informationauteur Android84