Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I just received my device and when I paired and connected the device it automatically sends the data to the currently focused EditText. What version of Android are you using because I tried it on ICS and JB and it worked this way. I have not tested it in any earlier versions. </p> <p><strong>Edit:</strong></p> <p>I downgraded my phone to Gingerbread and found out it does not work the same way but I have a solution:</p> <p>This is important! >> First you must scan the barcode in the manual that says "Serial Port Profile (SPP)". </p> <pre><code>btAdapter = BluetoothAdapter.getDefaultAdapter(); if (btAdapter.isEnabled()) { new BluetoothConnect().execute(""); } public class BluetoothConnect extends AsyncTask&lt;String, String, Void&gt; { public static String MY_UUID = "00001101-0000-1000-8000-00805F9B34FB"; @Override protected Void doInBackground(String... params) { String address = DB.GetOption("bluetoothAddress"); BluetoothDevice device = btAdapter.getRemoteDevice(address); try { socket = device.createRfcommSocketToServiceRecord(UUID.fromString(MY_UUID)); btAdapter.cancelDiscovery(); socket.connect(); InputStream stream = socket.getInputStream(); int read = 0; byte[] buffer = new byte[128]; do { try { read = stream.read(buffer); String data = new String(buffer, 0, read); publishProgress(data); } catch(Exception ex) { read = -1; } } while (read &gt; 0); } catch (IOException e) { e.printStackTrace(); } return null; } @Override protected void onProgressUpdate(String... values) { if (values[0].equals("\r")) { addToList(input.getText().toString()); pickupInput.setText(""); } else input.setText(values[0]); super.onProgressUpdate(values); } } </code></pre> <p>This is an incomplete version of my working code but you should get the gist.<br> I hope this solution works for you as well!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload