1

I need to develop an ANDROID client that will communicate with the server that runs WCF REST services.

Since I have limited experience with this I am looking a solution for:

  • pushing data to android device (the client needs constant updates from the server)
  • calling a method on server (reflection)

Any ideas/hints/samples are most welcome !

2 Answers 2

2

For push notifications, check out Google's C2DM framework (cloud to device messaging). It's available on Android 2.2 and up.

Basically, the phone will maintain an open socket with Google's servers, and when you want to push data to a device, you POST a request to Google from your web app (you'd likely use System.Net.WebRequest from .NET, for example), and they handle the rest.

For more info on setting up things from your Android app, see this tutorial.

Sign up to request clarification or add additional context in comments.

5 Comments

thanks wsanville. Currently it seems that is the only "proper" way to go. Or notify the server in intervals, but that is messy.
I would image Google's setup would be far better than any homegrown solution in this scenario.
As for C# libraries to help you out, see this question or the C2DM-Sharp Github project.
There's a walkthrough at codeproject.com/Articles/339162/…
C2DM is now deprecated. You can do the same with GCM (Google Cloud Messaging)
1

WCF doesn't have any push notification API except duplex messaging with callback channel but that is not available for REST services in WCF 4. In WCF any kind of client notification over HTTP is based with polling - you can use Comet like approach with long poll intervals.

In WCF 4.5 you will be able to use WebSockets and callback channel over HTTP but again the support for REST is up to you.

4 Comments

Thank you for your anwser. I am just looking into C2DM (Cloud to device messaging) and it seems that there is implementation for C#. Any thought on using this for pushing data to clients?
That is something you forget to mention in your question and it is mostly unrelated to WCF.
at the time I was unaware of C2DM
C2DM is your best choice. Accept the @wsanville's answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.