简体   繁体   English

如何在不预先从服务器轮询的情况下使android应用可访问?

[英]How to make an android app reachable without repreatedly polling from a server?

How can some service-style (long running) android apps be reachable over network although they do no polling from a server? 尽管服务风格(长期运行)的Android应用程序不从服务器轮询,但如何通过网络访问呢?

The info on Theis Borg's app Android Lost says: Theis Borg应用程序Android Lost上的信息说:

The app does no polling to a server, so there is no extra battery usage. 该应用程序不轮询服务器,因此没有多余的电池使用量。

( https://play.google.com/store/apps/details?id=com.androidlost&hl=en ) https://play.google.com/store/apps/details?id=com.androidlost&hl=zh_CN

I would like to find out how to write such apps. 我想了解如何编写此类应用程序。

(For broader audience, I've also posted this question on android.stackexchange.com ) (对于更广泛的受众,我还将这个问题发布在android.stackexchange.com上

Google Cloud Messaging (GCM) provides this functionality. Google Cloud Messaging(GCM)提供了此功能。 The Google Services Framework app (preinstalled on most Android devices) connects to Google servers and keeps that connection as long as the Android device has Internet connectivity; Google Services Framework应用程序(大多数Android设备上已预装)连接到Google服务器,并在Android设备具有Internet连接时保持该连接; this single connection is used to receive incoming GCM messages for all installed apps which use GCM, and the app which handles the message is started on demand — so it does not even need to be running in the background. 这个单一连接用于接收所有已安装的使用GCM的应用程序的传入GCM消息,并且处理该消息的应用程序是按需启动的,因此它甚至不需要在后台运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何实现从android应用中的http服务器获取实时事件? 没有轮询 - How can I achieve to get live events from a http server on an android app? without polling 如何在android中为AppIndexing添加键? 使应用程序更易于访问 - How to add keys for AppIndexing in android? To make the app more reachable 社交Android应用程序的通知系统 - 推送与轮询以及如何使服务器“推送” - Notifications System for Social Android App - Push vs. Polling & How to make a server “Push” 如何在Android中了解服务器是否可达? - How to know the server in reachable or not in android? Android定期从服务器轮询 - Android Polling from a Server periodically 如何让 Android 应用程序在没有互联网的本地服务器上等待来自 Python 的消息? - How to make Android app wait for a message from Python on a local server without internet? Android上的服务器可以从本地网络上的设备访问? - Server on Android reachable from devices not on local network? 定期从Android中的服务器获取数据(轮询) - Periodically fetching data (polling) from the server in Android 从android客户端到webapi服务器的连续轮询 - continuous polling from android client to webapi server 从服务器如何在没有任何请求的情况下调用Android应用程序? - From server how to call an Android app without any request?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM