Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Android Networking
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 27-Mar-12 23:04pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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)
  Permalink  
v3

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

  Print Answers RSS
0 Maciej Los 315
1 OriginalGriff 233
2 Aajmot Sk 224
3 Richard MacCutchan 220
4 Marcin Kozub 210
0 OriginalGriff 7,853
1 Sergey Alexandrovich Kryukov 7,107
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,790


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 28 Mar 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100