Click here to Skip to main content
15,885,998 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi all,

what is the best way to communicate with a remote server( developed in c# visual studio 2008) from an android based mobile phone?


1- to send files
2- to receive notification

Regards,
Amith
Posted

1 solution

Hi,

I would use http for both as it is the easiest to handle.
For receiving notification can poll in regular intervals.

Pros:

  • With SSL, encryption is quite easy
  • If the mobile phone looses the connection to the server, you don't have to reconnect or something else
  • Easy to implement (for C# you could use HttpListener, for android maybe this could help[^]
  • Flexible as you could even realize the same with javascript in a standalone website
  • Well-defined protocol for file-transfer

Cons:

  • Polling could cause some network traffic... But if you send only some bytes, I don't think this would be a big problem as for receiving notification with raw tcp you will cause some network traffics too (e.g. for checking whether the connection is still alive)
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900