简体   繁体   中英

Sending notification (few data) from PHP server side App to Android Client Side App

How can I send data from my PHP server side App to Android Client Side App in terms of Notification or something else i dont want to use C2DM ,is there any other Alternative.

I want to send such data on a particular event happen on server like a new row inserted in some table or existing row deleted by user A but also shared to user B.So i want to notify user B by sending some notification on his mobile.

A http communication between a Server and a Client is usually started by a client-request. Android has no service running which could be requested by the php server side, as an event happens. So the only way I could imagine is to use reverse ajax in this case.
Maybe take a look here:
Reverse Ajax implementation using php

The best thing is to create background service that will check ie every 10 minutes if content has changed. You could check it by adding simple revision number on server side and then compare it with saved on android. If something has changed download all/specific content.

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