Ubuntu One for Application Developers

Most of you will be familiar with Ubuntu One as the personal cloud service in which you can sync your files, buy music, and more. While the Ubuntu One team has been working hard to expand the end-user quality and experience of Ubuntu One, I wanted to share my experience with working with Ubuntu One from the perspective of an application developer.

A lot of people don’t realize that you can build support for Ubuntu One into your application and they provide a rather nice Python library to talks over DBUS to do this. Adding this support was simple.

The Ubuntu Accomplishments system was designed with Ubuntu One as a core piece. We didn’t use Ubuntu One because it had to be Ubuntu but instead that Ubuntu One solved a number of problems in building a decentralized application such as Ubuntu Accomplishments.

We wanted to be able to verify and validate accomplishments (so they can’t be faked), so we knew we needed a system in which we could transfer files over the network, process those files, sync the files back to one or more clients, and also provide a means in which you can view your trophies on any of your Ubuntu machines. Ubuntu One provided the ideal system for performing this syncing with the added benefits of being integrated into the Ubuntu experience.

Not that kind of sync.

So how does Ubuntu Accomplishments use Ubuntu One?

Like this:

  • When you load the application and enable support for verified trophies, it creates a directory on your computer and then marks it as an Ubuntu One share. It then offers the share to the validation service Ubuntu One user (which is just a regular Ubuntu One user that I tie some processing functionality to).
  • On the external machine (the validation server) I have a script that listens for Ubuntu One share offers and when the share comes in it accepts it.
  • When an accomplishment has been detected on the client machine the trophy is added to the share, which then automatically syncs to the validation server, and there we listen for an Ubuntu One signal to then kick off the verification. The signed trophy is then put back into the share which then syncs to the client.

As I mentioned earlier there is a Python module that I use to talk to Ubuntu One, and this not only provides methods to access all aspects of Ubuntu One (e.g. creating, offering, refreshing, listing, and subscribing to shares) but also provides a set of signals that you can connect to detect Ubuntu One sync events and handle them accordingly.

What is also nice, and lesser known in the community, is that you can run Ubuntu One on a headless machine. This is exactly what I am doing right now by running Ubuntu One an OpenStack image. You can find out how to set up Ubuntu One in a headless environment here.

Finally, many thanks to the Ubuntu Team for providing help and guidance for using their API.

Find out more about Ubuntu One app development features here.

  • edu ard

    Oh, cool :-)

  • Olaoye sunday

    Dear Jono Bacon,  I’m Sunday and I reside in Nigeria, I Bought your book on Practical PHP and MySQL building 8 dynamic web application 2 years ago. I love  your methodology but most of the codes didn’t work on my system. I used php 5.2 and Mysql 5.1.17. please which page can I check for correction or can you mail me : olaoyesunday@yahoo:disqus .com. Yours, Sunday

  • http://twitter.com/jspaleta Jef Spaleta


    Which apis are you using specifically?

    When the u1db API’s are public and stable (and I’m not sure that they aren’t yet) if this bit of code used them, this codebase may make for an excellent read-through example on how to use the new API.

    Its very good to see some quality dogfooding of the APIs by a casual coder.  I hope that some of those direct conversastions you’ve had with the u1 team can be distilled in a set of documented best practices so the next group of people don’t have to repeat the same conversations.   -jef

  • https://android-app-development.com/ Android application Developer

    Awesome! you can solve your queries directly through a developer.

  • http://jonathanchavez.hpage.com/ Roy Jordan

    Hey realy u post very nice information.. i like this post… thanks its use for me…