简体   繁体   中英

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?

The info on Theis Borg's app Android Lost says:

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 )

I would like to find out how to write such apps.

(For broader audience, I've also posted this question on android.stackexchange.com )

Google Cloud Messaging (GCM) provides this functionality. 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; 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM