Android Device and Desktop Clipboard Sync Utility

While developing for Android these days – Felt a lack of a utility which could be installed by developers to keep the Android device and the Desktop’s clipboards in sync.

There must be a gazillion ones on the Market, but here I am talking about a non-Google plain Vanilla Android emulator/phone which won’t have market and you’d have to cook up something like this to keep ur desktop and mobile clipboards in sync.

Sheesh, even Windows mobile 6.1 has a utility to do that (MyMobiler – a 3rd party utility because Microsoft didn’t care enough for the Windows mobile developers before!!!)

So announcing the Android Desktop Clipboard Sync utility – to never turn back and worry about clipboard (Well, its not all that huge, just made the line up!)

Android Desktop Sync

So I had to write my own. The current utility would have a “Desktop component” which acts as a server and the “Android side” client component which keeps sending data to the server.

I am maintaining the source code on Google Code and will try to keep release versions to maintain stable release.

The current code is an 0.1Alpha’s with source code is ready and would update the desktop clipboard with any changing mobile clipboard always.

The components explained

  1. Server side component – Usually runs on your desktop machine (I’ve tested this on Windows) – Written in Java
    This has a server socket and whenever receives an input data – updates the desktop clipboard.
  2. Mobile Side client – Runs on your Android Emulator or your device (should be connected to the PC through a network usually WiFi – Written in Java (using Android SDK) – Target set to 2.2 Froyo
This has a live thread checking if the device clipboard has been updated, If yes – It’ll establish a network connection to the server component to dump the latest clipboard.

I plan to modify this to include bidirectional sync (The code’s there but commented out – causing some problems).
To start using this android sync utility – Ensure

Steps to install and configure

  1. Check out the source from Google code SVN repository and mark as writable if required (If you need to change – See Step#2)

    svn checkout http://android-desktop-sync.googlecode.com/svn/trunk/ android-desktop-sync-read-only

  2. There are 2 projects in it – Import them into your Eclipse (already configured with Android SDK and has Java)
  3. AndroidClient – Is the Android project (modify it to your need in case you’re working below <2.2)
    Change the source code file ClipboardSharerApplicationActivity.java to connect to your machine’s IP address.
    I will probably later make this as a text field on the page so that the user can input the server (desktop’s) IP address and port number instead of hardcoding it.
  4. DesktopServer – Is the Desktop Java project which won’t require modifying unless you wish to change the server socket’s listening port.
    In case you wish to – you would be changing JavaDesktopClipboardAccessServer.java
  5. That’s the configuration – First launch the DesktopServer and then launch the Android Client.
  6. Voila! After this is done, you should see that anything you copy into the clipboard on the Android Device would be available on the desktop clipboard.

Happy Copy pasting! If you face any issues in setting up this – Let me know

[Icons Courtesy – Google Developers & Computer Icon + Me, cooking up both together with a weird bidirectional arrows]

Leave a Reply

Your email address will not be published. Required fields are marked *