Java android client communication with C# server

Go To


I am currently writing an application having a client server architecture.

The client is a Java android application The server is a C# application.

The client will pull data from the server but in some cases push some data to the C# server as well.

The data that server needs to forward the clients is list of data structures (perhaps in the form of XML?), sometime binary data like files.

The client and server are communicating over a wireless network.

Speed and scalability is my top most priority in the design of the system,...

I have to write server as well as the client myself. I will be using sockets for communication.

I need your advise on the form of protocol I should use to exchange data between the Java client and C# server.

Should I write similar data structures (which seems redundant) in java and C# and serialize them ??

or should I exchange xml ??

I am not sure yet what is the best way to do it .. Essentially there will be commands from client and server will respond with data

Please advise me on this topic the data communicated could be be as large as several gigs over wifi so speed is very important.

2012-04-03 19:54
by Ahmed
Overly broad for a SO answer - L.B 2012-04-03 20:05
It is a concern I need to address at the architecture/design level. I think have been specific about technologies - Ahmed 2012-04-04 16:26


Well, there's always JSON. It should be well-supported on both ends and is easy for your server to generate and client to consume. Not sure it helps with your bandwidth concerns any...

2012-04-03 22:13
by Jon O
I eventually had to choose json for this and worked well. - Ahmed 2013-04-24 00:57


I believe WCF might be approperiate for this, WCF uses soap so a Java implementation should work well. WCF also supports steaming, so transferring large files is possible, though I'm not sure if Java supports the streaming protocol.

As for performance, you will probably be limited by the speed of the device and not the protocol.

2012-04-03 20:04
by Matthew


Have a look at this session from TechEd 2011: "My Customers Are Using iPhone/Android,But I'm a Microsoft Guy. Now What?"

2012-04-03 20:13
by JMarsch


It would probably be worth looking into MonoDroid if you want to share code between client and server (and if serialize/de-serialize makes sense).

As I don't know what you're building, I would advise you to read up on REST before you continue though. It should give you valuable pointers on how to create a nice API that can be easily consumed by various clients.

2012-04-03 22:02
by TommyN