通过手机与服务器进行远程通信 [英] Remote communication with a server from a mobile phone

查看:208
本文介绍了通过手机与服务器进行远程通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

从基于Android的手机与远程服务器(在C#Visual Studio 2008中开发)进行通信的最佳方法是什么?


1-发送文件
2-接收通知

问候,
Amith

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

推荐答案



我会同时使用http,因为它最容易处理.
对于接收通知,可以定期进行轮询.

优点:

  • 使用SSL,加密非常容易
  • 如果移动电话断开与服务器的连接,则无需重新连接或进行其他操作
  • 易于实现(对于C#,您可以使用HttpListener,对于android,也许这可以帮助 [ ^ ]
  • 灵活,您甚至可以在独立网站中使用javascript来实现同样的功能
  • 完善的文件传输协议
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

  • 轮询可能会导致一些网络流量...但是,如果仅发送一些字节,我认为这不会是一个大问题,因为使用原始tcp接收通知也会导致一些网络流量(例如,用于检查连接是否仍然有效)


这篇关于通过手机与服务器进行远程通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆