2

What is the best way for me to handle or approach this situation:

So far I have a pretty straightforward application:

I have a MySQL server set up alongside a ASP.NET Web API 2 REST Service that is used to fetch data from the database and send it as a JSON object to a client. The client in this case is an android application which requests the JSON and receives it, then does some stuff with it.

Now I need to implement a comment/forum/chat for this particular thing I'm doing for users to communicate with each other.

So currently:

MySQL database < request and receive data > REST Web API < request and receive data > Android

I want to add the following:

android < send and receive message and push the message automatically > REST Web API

I have looked into using Google Cloud Messaging however I just cannot find enough documentation on using c# web api + gcm. When I do find something it's deprecated and from 2011 or 2012. Maybe I'm just not patient enough. Which also lead me to PushSharp which I am currently looking into.

Maybe I can program this from scratch/myself? I just need a way to tell the other user of the chat to refresh or to send the message to them to update with, is this possible in a web api? Using UDP/TCP/WEBSOCKETS?

Thank you guys. I hope everything makes sense.

Lucien Theron
  • 413
  • 3
  • 6
  • The correct way is through websockets, else you will do a lot of polling and the server resources will be wasted – Gusman Oct 22 '15 at 12:11
  • I think you can try SignalR – BNK Oct 22 '15 at 14:27
  • I'm not 100% sure what you are asking. I'm a bit confused by your use of < > :) However you can use C# with GCM. You can use HTTP or XMPP to do the messaging. – Arthur Thompson Oct 24 '15 at 23:08
  • The use of <> just show that I want communication both ways. But I looked at what BNK mentioned signalR and seems like what I was looking for. How do you push using http? – Lucien Theron Oct 25 '15 at 09:42

0 Answers0