简体   繁体   中英

Developing an android app with gcm.

I am planning on developing an android application that sends a reminder and sets an alarm corresponding to that on other person's phone who has that app installed on his/her phone. Now the reminder is actually a bundle of data that includes date/time and a message for that reminder. The App is going to send a reminder bundle to a server and then the server will redirect the message on the intended person's phone. Now what i understand from this is that of a bi-directional communication. I have studied Google Cloud Messaging HTTP and XMPP(CCS). I'm confused which protocol is perfect for an app like mine. Any help is of high regard.

Have your app register with GCM, send resulting token to server and bind it with user account. Your app sends the alarm settings to server along with to which user the alarm is for. You server looks up GCM token of the targeted user and send message to that device, your app, telling it to update its alarms from the server. Then your target app can eg register an alarm with AlarmManager or what ever suites your purpose.

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