when we need it (application opened ?) CONS the data is not here when user want it what happens when no data or (worst) slow data when you open the app ? POLLING
received in background by the app CONS server side filtering and triggering > server side dev we have to have a schema for datas to react on > update client AND server SERVER SIDE PUSH
or cost to use a SAAS (Firebase, …) NOT MOBILE FRIENDLY you have to keep your app running to maintain the connection connection use a lot of battery PERMANENT CONNECTION
data is saved or data modified, notify subscribed mobile apps Mobile apps receive the notification and download the new data Triggered polling ONE SOLUTION
use to send push notification (GCM) on data changes. When the app receive this push notification, it can download the changes in background. Triggered polling ONE SOLUTION
*/ static public void register(String type) { ParseInstallation i = ParseInstallation.getCurrentInstallation(); i.addUnique("sushi", type); i.saveInBackground(); } // Dynamically register to class of data (can register many) Sushi.register("MyClassOfObject"); CODE
public Task<Void> saveEventually(ParseObject obj) { Task<Void> result = obj.saveEventually(); updateLastMod(obj.getClassName()); return result; } /** * send the update trigger to the server * @param className the class of saved object */ static private void updateLastMod(String className) { ParseObject ev = new ParseObject("SushiUpdates"); ev.put("objectName", className); ev.saveEventually(); } CODE
client for same class of data if he didn’t already query for the data Sync point the client must query new data since last sync Continuous query add parameters to subscription