从服务器发送数据到android应用 [英] Send data from server to android application

查看:96
本文介绍了从服务器发送数据到android应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是在将数据从一台服务器从Android应用程序发送到Android设备的最佳方式?我的当前设置:

What is the best manner in which to send data to an android device from a server from an android application? My current setup:

PostgreSQL数据库 - >程序服务器计算机上运行 - > Android设备。

Postgresql database --> program running on server machine --> android device.

我目前使用的是自定义协议,但我最终想使我的数据源在逃提供给应用程序开发社区。因此,我想知道由我可以为这个数据的最佳和最简单的选择。

I currently am using a custom protocol, but I would ultimately like to make my data source available to the app development community at large. As such, I would like to know the best and most simple options by which I can serve this data.

推荐答案

我读了你需要这个的时候了。我有两个建议供您参考。

I read that you need this right away. I have 2 suggestions for you.


  1. HTTP池。保持移动应用击中到服务器具有限定频率说响应于击中2分钟,服务器可以发送愿望信息到移动设备。这基本上取决于你希望多久服务器联系到移动应用程序的速度。

  1. HTTP Pooling. keep the mobile application hitting to server with a defined frequency say 2 minutes in response to hit, server can send the desire information to mobile device. This basically depends on the rate how often you expect the server to contact to mobile application.

[推荐]用 TCP方式移动和服务器之间的通信。我推荐这个,因为在TCP连接,服务器可以推送消息的移动应用程序,而不在移动应用不断击中服务器。

[RECOMMENDED] Use TCP mode of communication between mobile and server. I recommend this because in TCP connectivity, server can push message to the mobile application without the mobile application keep on hitting the server.

这篇关于从服务器发送数据到android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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