Coder Social home page Coder Social logo

syncschedule's Introduction

SyncSchedule

尝试过以下多种方式去实现app和服务端的常活跃。理想效果就是app能够在需要的时候和服务端交互数据,当然,肯定是在不需要打开app的情况下实现。

1、GPS定位:通过一直获取地理信息,类似于百度地图的导航功能,该方法基本可以达到目的。但是受限于很多人不一定开启位置服务,而且该方法会导致耗电很快,最终没有采用。

2、音乐播放:这个就比较简单了,app中循环播放一段无声的音频,但是在锁屏状态下时会显示player界面,而且无法通过自定义移除这个界面。肯定不行也是没有采用。

3、VOIP:钉钉、QQ、微信的语音通话就是通过这个来达到不开启app情况下,唤醒接电话界面。原理就是通过voip提供的推送协议,在每次静默推送的情况下app内接受到推送消息,会给出大概10秒钟时间处理事件。通过此10s时间可以对数据进行处理和服务器交互。而且该方法可以在app杀掉进程,手机重启之后唤醒app。最后服务器可以定时几分钟给每个用户推送一次,定时唤醒app,达到心跳机制。这就是我们想要的方法。

syncschedule's People

Contributors

ktdynamic avatar mrtung avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.