Code example for BluetoothSocket

Methods: getRemoteDevice

0
  ByteArrayOutputStream bos = new ByteArrayOutputStream();
 
  public HxMDataReader(BluetoothSocket socket)
  { 
    this.socket = socket;
    this.address = socket.getRemoteDevice().getAddress();
  } 
 
  @Override 
  public void read() throws IOException 
  { 
    InputStream stream = socket.getInputStream();
    byte[] readBuffer = new byte[4096];
 
    int bytesRead = stream.read(readBuffer);
    if (bytesRead > 0)
    { 
      bos.write(readBuffer, 0, bytesRead);
      int processed = reader.tryReading(bos);
      if(processed > 0)
Stop searching for code, let great code find you!  Add Codota to your java IDE