<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Oxygen-Sans'; font-size:10pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Yes.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Thank you, Philip. I'll likely use some of the logic here in the Android code.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">By any chance, if you have two Android devices, could you test the code and see what happens?</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br />On Thursday, January 15, 2015 20:55:45 Albert Vaca wrote:<br /></p>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">I see some possible collaboration here? :D</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">On Wed, Jan 14, 2015 at 3:25 PM, Philip Cohn-Cort <<a href="mailto:cliabhach@gmail.com"><span style=" text-decoration: underline; color:#0057ae;">cliabhach@gmail.com</span></a>> wrote:<br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:46px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:46px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:46px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">On Wed, Jan 14, 2015 at 11:06 AM, Saikrishna Arcot <<a href="mailto:saiarcot895@gmail.com"><span style=" text-decoration: underline; color:#0057ae;">saiarcot895@gmail.com</span></a>> wrote:<br /></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="2" cellpadding="12" bgcolor="#f9f3c9">
<tr>
<td>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif';">This is an automatically generated e-mail. To reply, visit: </span><a href="https://git.reviewboard.kde.org/r/122020/"><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif'; text-decoration: underline; color:#0057ae;">https://git.reviewboard.kde.org/r/122020/</span></a><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif';"> </span></p></td></tr></table>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif';"><br /></span></p>
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif';">On January 13th, 2015, 8:33 a.m. UTC, </span><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif'; font-weight:600;">Albert Vaca Cintora</span><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif';"> wrote: </span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:19px; margin-right:40px;" width="100%" cellspacing="2" cellpadding="0" bgcolor="#ffffff"><thead>
<tr>
<td colspan="4" bgcolor="#f0f0f0" style=" padding-left:8; padding-right:8; padding-top:4; padding-bottom:4;">
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><a href="https://git.reviewboard.kde.org/r/122020/diff/2/?file=341485#file341485line157"><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif'; font-size:9pt; font-weight:600; text-decoration: underline; color:#000000;">src/org/kde/kdeconnect/Backends/BluetoothBackend/BluetoothLink.java</span></a><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif'; font-size:9pt; font-weight:600;"> </span><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif'; font-size:9pt;">(Diff revision 2) </span></p></td></tr></thead>
<tr>
<td bgcolor="#b1ebb0"></td>
<td width="50%" bgcolor="#c5ffc4"></td>
<td bgcolor="#b1ebb0">
<p align="right" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif'; font-weight:600;">157</span></p></td>
<td width="50%" bgcolor="#c5ffc4">
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; font-size:8pt;">            Thread thread = null;</span></pre></td></tr>
<tr>
<td bgcolor="#b1ebb0"></td>
<td bgcolor="#c5ffc4"></td>
<td bgcolor="#b1ebb0">
<p align="right" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif'; font-weight:600;">158</span></p></td>
<td bgcolor="#c5ffc4">
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; font-size:8pt;">            if (np.hasPayload()) {</span></pre></td></tr>
<tr>
<td bgcolor="#b1ebb0"></td>
<td bgcolor="#c5ffc4"></td>
<td bgcolor="#b1ebb0">
<p align="right" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif'; font-weight:600;">159</span></p></td>
<td bgcolor="#c5ffc4">
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; font-size:8pt;">                thread = sendPayload(np);</span></pre></td></tr>
<tr>
<td bgcolor="#b1ebb0"></td>
<td bgcolor="#c5ffc4"></td>
<td bgcolor="#b1ebb0">
<p align="right" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif'; font-weight:600;">160</span></p></td>
<td bgcolor="#c5ffc4">
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier'; font-size:8pt;">                if (thread == null) return false;</span></pre></td></tr></table>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:19px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier';">If the np doesn't have a payload (which is what happens most of the times, payloads are only used when sending binary data like entire files) you are actually not sending anything! Don't worry about payloads yet, and start by implementing sending and receiving simple packages.</span><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif';"> </span></p>
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif';">On January 14th, 2015, 2:21 p.m. UTC, </span><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif'; font-weight:600;">Saikrishna Arcot</span><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif';"> wrote: </span></p>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:19px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier';">Ok. I didn't really understand the distinction between the payload and the (unserialized) message. I've changed the code to send a message and to print an error message if there is a payload.</span><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif';"> </span></p>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:25px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier';">According to the KDE code, the network package messages are separated by a newline. Can the newline character be used to indicate the end of a message?</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Yes, I think so.<br /><br />If it helps, I started work on a bluetooth backend for android a few months ago. It works for simple pairing, ping, and some sharing on Android 2.3 and up but I couldn't make it reliable - frequently, the acceptor doesn't read anything out of its BluetoothSocket despite the transmission going through properly.<br /><br />The code is up on my github at <a href="https://github.com/Cliabhach/kdeconnect-android/tree/feature/bluetooth"><span style=" text-decoration: underline; color:#0057ae;">https://github.com/Cliabhach/kdeconnect-android/tree/feature/bluetooth</span></a> and I'd be glad to try to help out.<br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:46px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">~Philip  </p>
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif';">On January 14th, 2015, 2:19 p.m. UTC, Saikrishna Arcot wrote: </span></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="12" bgcolor="#fefadf">
<tr>
<td>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif';">Review request for kdeconnect.</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif';">By Saikrishna Arcot. </span></p>
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif'; font-style:italic; color:#808080;">Updated Jan. 14, 2015, 2:19 p.m.</span><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif';"> </span></p>
<p style=" margin-top:29px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif'; font-weight:600; color:#575012;">Repository: </span><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif';">kdeconnect-android </span></p>
<p style=" margin-top:29px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif'; font-size:xx-large; font-weight:600; color:#575012;">Description </span></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="10" bgcolor="#ffffff">
<tr>
<td>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier';">(Note that this isn't ready for merging yet.)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier';">This is an initial implementation of a bluetooth backend. This backend implementation can be run only on Android 4.0.2 or higher. The implementation as-is only looks at already-bonded devices; it does not start a discovery session to see other bluetooth devices nearby.</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier';">There are several things that need to be worked out.</span></p>
<ol style="margin-top: 0px; margin-bottom: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" font-family:'Courier New,courier';" style=" margin-top:0px; margin-bottom:0px; margin-left:38px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">When requesting permission to enable Bluetooth (if it's not already enabled), <span style=" color:#4444cc;">startActivityForResult</span> needs to be called. However, this must be called by a class that implements <span style=" color:#4444cc;">Activity</span>. One possible solution is to call this on the home screen. Another is to just not request it.</li>
<li style=" font-family:'Courier New,courier';" style=" margin-top:0px; margin-bottom:0px; margin-left:38px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">I believe starting a discovery session also requires calling <span style=" color:#4444cc;">startActivityForResult</span>, which has to be called from a class that implements <span style=" color:#4444cc;">Activity</span>. The same solutions for the previous item exist here.</li>
<li style=" font-family:'Courier New,courier';" style=" margin-top:0px; margin-bottom:0px; margin-left:38px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Options for enabling the Bluetooth backend need to be added to the settings window.</li>
<li style=" font-family:'Courier New,courier';" style=" margin-top:0px; margin-bottom:0px; margin-left:38px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Some sections of code may warrant a new thread being created, as they may take a while to run.<span style=" font-family:'Verdana,Arial,Helvetica,sans-serif';"> </span></li></ol></td></tr></table>
<p style=" margin-top:29px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif'; font-size:xx-large; font-weight:600; color:#575012;">Testing </span></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" width="100%" cellspacing="0" cellpadding="10" bgcolor="#ffffff">
<tr>
<td>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier';">Installed on my Android 4.1.2, and it correctly detected that there are 2 bonded devices. No crashes.</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Courier New,courier';">Note that since the KDE side doesn't have a bluetooth backend, much of the code wasn't executed.</span><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif';"> </span></p></td></tr></table>
<p style=" margin-top:29px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif'; font-size:xx-large; font-weight:600; color:#575012;">Diffs </span></p>
<ul style="margin-top: 0px; margin-bottom: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" font-family:'Verdana,Arial,Helvetica,sans-serif';" style=" margin-top:12px; margin-bottom:0px; margin-left:57px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">AndroidManifest.xml <span style=" color:#808080;">(6cbe4a7830cfe416fe98e42be143c0f26f2bf1e8)</span> </li>
<li style=" font-family:'Verdana,Arial,Helvetica,sans-serif';" style=" margin-top:0px; margin-bottom:0px; margin-left:57px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">src/org/kde/kdeconnect/Backends/BluetoothBackend/BluetoothLink.java <span style=" color:#808080;">(PRE-CREATION)</span> </li>
<li style=" font-family:'Verdana,Arial,Helvetica,sans-serif';" style=" margin-top:0px; margin-bottom:0px; margin-left:57px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">src/org/kde/kdeconnect/Backends/BluetoothBackend/BluetoothLinkProvider.java <span style=" color:#808080;">(PRE-CREATION)</span> </li>
<li style=" font-family:'Verdana,Arial,Helvetica,sans-serif';" style=" margin-top:0px; margin-bottom:12px; margin-left:57px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">src/org/kde/kdeconnect/BackgroundService.java <span style=" color:#808080;">(576425cf568e4b223d9840842803d7adabf6b990)</span> </li></ul>
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><a href="https://git.reviewboard.kde.org/r/122020/diff/"><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif'; text-decoration: underline; color:#0057ae;">View Diff</span></a><span style=" font-family:'Verdana,Arial,Helvetica,sans-serif';"> </span></p></td></tr></table>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br />_______________________________________________<br />KDEConnect mailing list<br /><a href="mailto:KDEConnect@kde.org"><span style=" text-decoration: underline; color:#0057ae;">KDEConnect@kde.org</span></a><br /><a href="https://mail.kde.org/mailman/listinfo/kdeconnect"><span style=" text-decoration: underline; color:#0057ae;">https://mail.kde.org/mailman/listinfo/kdeconnect</span></a><br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">-- </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Saikrishna Arcot</p></body></html>