I’ve been trying to learn Android programming for several weeks after learning Ravi Tamada - AndroidHive . I created an application that performs Create, Read, Update, and Delete (CRUD) actions. Similar to this .
Now what I want in my application is another function, when all the information is created and / or updated in the database, the application sends notifications to other Android phones that have the same application .
I researched and stumbled upon Google Cloud Messaging, in which AndroidHive also has a tutorial. I see that only the server can send notifications to devices, and GCM cannot execute: “Device to another device” For example, “The device creates data → send to the database → GCM sends notifications to other devices”, Correct me if I am mistaken.
So, I searched again and found that you can use the Smack for Instant Messaging app. Similar to what I want my application to run. But it's hard for me to understand and implement Smack for Java and Android.
So what I want to know:
1.) Is it possible for GCM to listen on a device to check if the application has changed the database and sends a notification to other devices that there is a change in the database?
2.) Do you have links to articles on "noo-friendly" links on how to have a basic understanding and implementation of Smack in Java-Android?
Thanks.
source share