Take the 2-minute tour ×

What is the best way for the communication between an Android app(native app) & a desktop App(C#/Java Client) over GAE? One way I found was Channel API. Unfortunately I found no client side scripts other than Javascript supports Channel API. Another way was to make a static class and communicate through these static variables.

This is what I'd like to achieve:

  1. I want an Android app to send a message to GAE.
  2. This message should be retreived by my PC App(C#/Java client)
  3. PC App should return a response to this message
  4. PC response should send to Mobile App.

Actually I am trying to execute commands on the windows command prompt from my mobile.

share|improve this question
What do you mean with static class communication??? There is different machines: gae, desctop and mobile. How you can run same (=one instance) virtual machine on such (=distributed) environment? –  Igor Artamonov Jan 4 '12 at 7:31
Means, a message from ClientA will be stored into a static string variable, which can later be obtained by client B. I am searching for better solution than these. –  Vivek Jan 4 '12 at 8:52
And how it can be related to 'Channel API'? static var/memcached/database is storage option. channel api/xmpp/http/email is communication option. You can (and even you need it) use both options at same time. –  Igor Artamonov Jan 4 '12 at 9:19
What are the requirements of your communication? –  skyjur Jan 4 '12 at 12:14
Ok, why not standard http calls? –  Igor Artamonov Jan 5 '12 at 8:56

2 Answers 2

How about:

Android <-> App Engine : C2DM

Here's a good video about it:


C#/Java <-> App Engine : Http Post/Get, create a http servlet at the app engine side. And standard http request on c#/java.

Here's a blog about the servlet side:


share|improve this answer

Basically this is how it works:

  • GAE handler receives messages from mobile device over http, and stores it to datastore. Here is an example of request which is done by movile device over http:

    POST http://myapp.appspot.com/messages
    Content-type: application/json
    {"message":"Message from mobile device","userid":"myuserid",[other data..]}
  • Desktop app makes repetitive requests (every 10 sec or so) to GAE over http. GAE handler will give an empty response if there are no new messages, but if message has arrived, message is loaded from datastore and served over http, so you application will receive it. Here is request example:

    GET http://myapp.appspot.com/messages?last_message_id=...

    Database query example:

    SELECT * FROM messages WHERE message_id > LAST_MESSAGE_ID

    Response example:

    Content-type: application/json
    [{'id':1, 'message':'Message 1 from mobile device','userid':1},
     {'id':2, 'message':'Message 2 from mobile device','userid':1}]

With Channel-API, it is possible to make one long request (long-polling) instead of many repetitive every 10 seconds. It is more efficient but it will be more difficult to implement if libraries does not exists.

I cannot recommend you specific libraries because I don't code in C# or Java, but all you need is a library which can make http requests, and also a library which encodes and decodes data in your chosen format. JSON data encoding is used in my example.

share|improve this answer

Your Answer


