Tag Archives: tornado

My last entry walked through the Android application for the C2DM PoC. This one will look closer at the server side.

The web server is written in Python and sits on top of the tornado framework. To get started you will first need to check it out from github.

Then there are two things that needs changing for the serve to run. First of, tornado is included as a git sub module. In order to get the tornado server you need to run the below commands, when in the project folder, in the terminal:

This will pull down tornado from their github repository.

Secondly you will need to change the following two lines (lines 36 and 37) of code in c2dm/c2dm_service_facade.py:

Replace the Google account with the account you have registered to use with C2DM and the password with the password for said account.

You should now be ready to go. To launch the server on port 8888 execute the following terminal command:

There isn't much more to it. As I have said before not all requirements for C2DM is met by this application but it will work as a prof of concept.

1 Comment

I have been trying out Cloud to Device Messaging (C2DM). It is a technology from Google that makes it possible to send small messages to an Android Devices running Froyo, the latest Android 2.2 release with the Google API's enabled. The application is a very simple prof of concept that illustrates how the technology can be used. It is however not a full implementation and it is missing some required functions.

The PoC is composed by two different sub-systems, an Android application and a web application server. The servers is written in Python and is leveraging Tornado.

The system supports the message sequences depicted in the diagrams below:

Register a device for C2DM:
Register a device for C2DM

Sending a message to device:
Sending a message to device

In the two coming posts I will walk through how each of the sub-systems (device application and web server) works. If you are aching to get your hands on the code you will find it on github: Android application, Web server.

You will find the device side introduction here and the server side introduction here.