Thursday, December 13, 2018
This post goes into some more detail on the 2.1 update for Clipboard Everywhere, released December 12th, 2018.
SuperDrop is a feature that allows you to very easily send files between your devices, wirelessly, over a local network. Since they don't go over the internet, you can enjoy some pretty great speeds. Between my desktop and Note 9, I'm getting about 28MB/s (~224Mb/s).
This is a great feature, and it couldn't be easier to use. From an Android device, simply share your files to Clipboard Everywhere, select a target device from the list that appears, and watch the magic as your files copy over! To send from Windows, simply drag-and-drop your files into the Clipboard Everywhere window. As SuperDrop uses the local network rather than wifi-direct (Wi-Di), it also works with Ethernet connected devices. It also works with virtual machines using Bridged networking (where the VM has direct access to a network adapter and gets its own IP on the local network), so you could use it inside VirtualBox or VMWare.
To make this feature work, users will now give a name to their device in the Files tab, if they want to use this feature. Whatever name you give here will then be immediately visible to your other devices, allowing you to receive files from them.
Security is always very important, and so Clipboard Everywhere optionally allows you to end-to-end encrypt your SuperDrop transfers, using the exact same encryption protocol as is currently used for your Clipboard Items. This has the benefit of each side already knowing which key to use for encryption and decryption.
Encryption is very simple to use, requiring only a quick toggle when initiating a transfer. See the screenshot below. To encrypt the transfer, enable the toggle on the right side, or disable it to send unencrypted.
You may wonder why you would want to be able to enable or disable encryption for each transfer. End-to-end AES-256 encryption is a great feature for your security and privacy, but comes at a significant performance cost. In my case, transferring between Note 9 and high end desktop, it's around an 85% speed reduction, but this will vary with your hardware. I suspect that the speeds will be much better between two high-spec PCs, as the bottleneck is likely to lie in the CPU performance due to encryption and decryption. I would like to test this with my Surface Pro 4, however it is unfortunately not very usable right now, due to a hardware defect.
The encryption toggle defaults to being enabled, but will remember what you last set it to. I recommend disabling it for transferring non-sensitive data, and enabling it for sensitive data, so that you can enjoy the high transfer speeds where appropriate. In my case, most sensitive data that I transfer is already pre-encrypted, so I tend to not use the encryption here.
These transfers also don't use much memory, limited to a few MB per transfer. I find this to be a sweet spot for minimizing memory usage and transfer speeds. It's also important not to allocate too much memory into the large object heap for the Android app, as that app supports running as 32-bit. As such, if you're not careful, you will exhaust and fragment the large object heap if you allocate too many large buffers, so in the next update I will be intelligently re-using them. This wouldn't be an issue with the Windows Desktop app as I support only 64-bit there, due to some quirks with the Windows Clipboard, but due to this it benefits from the vastly larger virtual address space available to 64-bit apps, but it still follows the same rules. This still shouldn't be much of an issue with 32-bit Android configurations, unless you transfer more than a few hundred files before restarting the app, at which point it may crash due to the large object heap running out of continuous free memory. I haven't actually encountered this myself, but I'll prevent it in the next update.
Though the file is transferred over the local network, an internet connection is required to use the feature. This is primarily for reliability but also presents a security benefit. The files are sent over a TCP connection using my SuperDrop protocol, and as such, one device initially needs to listen on a specific port. I don't want to choose a static port and leave that open all of the time, because anyone could connect to it at any time. Whilst that wouldn't be a direct security threat, it's not an optimal technique either as it could leave you open to abuse through the network, especially if you're using an unsecured public network. Therefore, when initiating a transfer, the two devices will communicate through the Clipboard Everywhere service to open up a socket and initialize the transfer. The sending device will then connect immediately, and the receiver will stop listening for new connections. This means the receiving device only listens for a few seconds at most, making it impractical for someone to pre-empt the connection.
I expect that I will be able to gain some slight performance improvements for the encrypted transfers through optimization, but I wouldn't expect significant changes to the speeds there.
This is the new Files tab. You can see all of the files and folders you have received through SuperDrop, navigate through them, and further share them. With the file names, you can only see as much of the name as will fit in the width of your device. Initially, I decided that when rotating your device, you should see multiple files per row. However, I eventually decided against this, and so when rotating your device, the layout doesn't change at all, but you should be able to see the full file name due to the added width in landscape mode.
I'm glad I reached this conclusion, as some of the Samsung apps are very annoying when you rotate them. You can't see the full file name in Samsung Files or Samsung Music in portrait, so you rotate the device, and rather than seeing more of the file name you get your screen width split between the files and some panel on the left side. iTunes on iPhone is also a culprit with this, so I think my solution here is a nice way to subtly improve the user experience.
From the Files tab, in addition to re-sharing files, you can delete them (with confirmation) and navigate through folders. Notice that the folder displays the size of all files within. In the app, files are displayed with their extensions (extensions are not shown here as the image has been edited for privacy), and the icons to the left of files reflect their type. Image icon next to an image, video icon next to a video, and there are multiple more icons for other formats (11 total + Folder icon). These are FontAwesome icons.
Finally, you can see your current path through your folders near the top, under where it says "Files On This Device". New "path segments" are displayed when you navigate deeper through your folders, and you can click them to quickly go back, or you can use the back navigation button to go back one level.
Since the previous update, I've upgraded to a new phone, moving from an S6 Edge+ to a Note 9. As such, I've noticed two issues that only affect devices running Android 8 or above. One was that if you had copied something on one of your devices whilst your Android 8 device was sleeping, and you then woke your Android 8 device, that item you copied would not be on your Android 8 device's system clipboard. This was not intended behaviour, and on previous Android versions the item would automatically have been placed on the system clipboard, but this issue has now been resolved.
Another issue is that the persistent notification is very annoying on Android 8. Every time you unlock your phone, it vibrates and displays heads-up. This is a new "feature" from Google, which highly frustrates me. The new tutorial for Android contains a page on this, displayed to users on Android 8 or above. Sadly, as I deploy new versions of the app to my phone many times per day for testing, this doesn't fix the issue for me as I have to complete the steps after every deployment, but my users will be covered after completing the steps once.
In the previous post, I mentioned how I had ported my applications to use the Xamarin.Forms framework, to ease development. Xamarin.Forms is great and saves me a lot of time, but hasn't come without its problems. In addition to the game-breaking bug with macOS targets that caused me to drop the macOS app from my 2.0 release, I've experienced several strange layout and control issues. For example, alerts on the Windows Desktop app can actually be clicked through, which has caused me to make custom alerts in some places. I've also experienced multiple layout bugs that would crash my applications, causing me to entirely re-design certain layouts to use less-buggy controls. It's also caused me some performance issues with clipboard searching and filtering, due to having to design around the bugs, which I may now be able to resolve thanks to what I'm about to tell you.
The latest such issue I ran into was that, when the Android app was minimized and receiving a SuperDrop transfer, the app had a good chance of crashing. This was another issue with some of the layout code in Xamarin.Forms, and this time, I decided that I had to do something about it, because Xamarin would probably take weeks to release a fix, and I didn't want to put back my release that far.
Xamarin.Forms is open source, and tech-aware consumers often say that they want open source software, but I don't think they really understand the meaning of it. I think they expect that others will look through the code to make sure it's not doing anything malicious, but won't make the effort themselves because it's not their area. Often, I think this provides a false sense of security to them. In my case, if frameworks that I use are open source, it means that I can fix any issues within them myself, without having to wait on Microsoft's process to get the fix out.
I've done a lot of software development, but never got into the open source side. It's a bit of a hurdle. When you get your packages from NuGet, nobody tells you how you can use the source code of those packages to build your own replacements. Well, nobody except Jon Goldberger from Xamarin: Debugging Xamarin Open Source Frameworks: Part 1 – Xamarin.Forms.
This link was very helpful. Thanks to his guide, I was able to learn the rules of open source, how to better interact with it, and even fix Xamarin's problems for myself. Thanks to his guide, I was able to debug their framework and apply my own fix, which I've used for this release of Clipboard Everywhere. So, this update to Clipboard Everywhere comes with my own Xamarin.Forms fork, containing my small fix, which resolves this layout bug. I'm very happy about this, because I wasn't prepared to release an unstable Android app.
I did submit a simple fix to Xamarin, and I hope they will incorporate it back into their framework, as is the Open Source flow. That way, I won't have to maintain my own fork of the framework, but may often run with my own fork anyway, as I doubt the bugs are over.
Finally, as the last part of getting this release ready, I decided to update the Clipboard Everywhere website. It now has a theme that matches the apps, with some cool 3D screenshots that I edited in Photoshop, and what I think is a more attractive home page. I've made the feature descriptions on the home page more concise, as the previous format was getting a bit out of hand. I'm quite happy with it.
Next, I'll be looking into bringing back the macOS app, which was taken out of action by a bug in Xamarin.Forms, and I hope I will be able to release it as a standard release, rather than as a Preview.
After that, I plan to release some smaller features surrounding the new SuperDrop feature. For example, the ability to have synced folders, which will automatically sync between your devices, using the local network. I'm also planning some theme updates and other convenience features, which I will discuss in a future post.
Clipboard Everywhere is available for Android and Windows Desktop. You can download the apps from the website at clipboardeverywhere.com or through Google Play (Android). Register now to get a 7 day free trial, and see what you think!