Note that there are some explanatory texts on larger screens.

plurals
  1. POhow can i transfer image from PC to Mobile via bluetooth using RFCOMM in java?
    primarykey
    data
    text
    <p>I did following coding @ PC side (I tried to sent data in chunks):</p> <pre><code>try { for (int i = 0; i &lt; sdata.length / 2; i++) m_Output.write(sdata[i]); } catch (IOException ex) { Logger.getLogger(SPPServer.class.getName()).log(Level.SEVERE, null, ex); } int i = sdata.length / 2; try { m_Output.flush(); } catch (IOException ex) { Logger.getLogger(SPPServer.class.getName()).log(Level.SEVERE, null, ex); } for (int k = i; k &lt; sdata.length; k++) { try { m_Output.write(sdata[i]); m_Output.flush(); m_Output.close(); } catch (IOException ex) { Logger.getLogger(SPPServer.class.getName()).log(Level.SEVERE, null, ex); } } </code></pre> <p>While at mobile side I receive it as:</p> <pre><code>public Image recdata() { Image image1 = null; int i = 0; try { // input = StrmConn.openInputStream(); length = input.read(); data1 = new byte[length]; length = 0; int ch = 1; while (length != data1.length) { ch = input.read(data1, length, data1.length - length); if (ch == -1) { throw new IOException("Can't read data"); } length += ch; } try { // int len = ch; input.wait(2000); } catch (InterruptedException ex) { ex.printStackTrace(); } length = input.read(); byte[] data11 = new byte[length]; try { this.wait(1700); } catch (InterruptedException ex) { ex.printStackTrace(); } while (length != data11.length) { ch = input.read(data11, length, data11.length - length); if (ch == -1) { throw new IOException("Can't read data"); } length += ch; } length = data1.length + data11.length; data12 = new byte[length]; for (i = 0; i &lt; data1.length; i++) { data12[i] = data[i]; } for (int k = i; k &lt; length; k++) data12[k] = data[k]; } catch (IOException e) { System.err.println("U must correct"); } if (image1 == null) { S = "Imagr is null in recive data"; } return image1; } </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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