Apr21

Android to Android push notifications

Thursday, 21 April 2016 Escrit per Marc Farssac Categories Google Cloud, Mobile App, 2016, Technology, News

Bidirectional communication between mobile devices applicable to many problems / products

Android to Android push notifications
Our last development has been for a Mobile Taxi App project. Our customer required a working sample and code of an Android client and the backend needed to communicate distributed mobile devices with each other.

Thanks to the Google Cloud Messaging we let devices communicate with each other without having to pull the backend in search of requests. Each mobile device starts a bidirectional communication with another device exchanging their address on the way that will be used to reply back to the request. This is done by means of a notification with data on the pay load that will be managed by the Android App.

Notifications are also an excellent way to activate our users to use our App and can lead to make the user perform a certain action such as purchasing a product, inform of a service or provide with specific information.
Our prototype has the role of a driver or a passenger based on the email adress. Once the user is logedIn, the passenger can request the services of a Taxi Driver and the driver, receives requests from passengers.

The App has on one side listeners for incoming notifications and the other a service to deliver them when needed.
The architecture that makes this possible counts with the GCM Google Cloud Messaging Connection Servers who receives messages from our Backend App server and sends them to registered Android clients. Devices register and unregister with our Backend server so that we know all the time who is on the field. Using the XMPP (Extensible Messaging and Presence Protocol) we return information from our devices to the Application server such as for example, what has our user decided.


Project summary

This project has OAuth2 user validation. It registers devices with the Google App Engine Mobile backend. It sends notifications from the Google Cloud Messaging Connection Server to the registered devices and receives information from devices on the same way. Pushing notifications from Android devices instead of pushing them directly from a server it is an interesting characteristic of this solution an particular to it. We communicate a passenger and a driver with them, establishing a link between two mobile devices. Such approach is not only valid for Taxi Apps, but is similar to the one that Chat Apps or even WhatsApp use to communicate their users with each other.
No video selected.

Search this Website

Sponsors

  • Available space for sponsors

Android Apps