从服务器发送数据到android应用

编程入门 行业动态 更新时间:2024-10-24 22:28:28
本文介绍了从服务器发送数据到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.

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

  • 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应用

    本文发布于:2023-11-27 09:01:34,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1637406.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:服务器   数据   android

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!