Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Push Notifications in Android Platform

I am looking to write an app that receives pushed alerts from a server. I found a couple of methods to do this.

  1. SMS - Intercept the incoming SMS and initiate a pull from the server
  2. Poll the server periodically

Each has its own limitations. SMS- no guarantee on arrival time. Poll may drain the battery.

Do you have a better suggestion please? Thanks very much.

like image 592
Vinod Avatar asked Sep 04 '09 11:09

Vinod


People also ask

Does Android have push notifications?

Android Push Notifications For Android, the notifications by default appear on the lock screen, and when the phone is unlocked, are visible as small icons on the notification bar at the top of the screen.

What platform should we use to be able to do the push notification?

Chrome, Firefox, Microsoft Edge, and Other Browser Notifications. Most browsers support the Web Push API standard. This API can be used on both desktop and mobile devices to allow notifications from websites and to receive those notifications even when a website is closed.

How do I push notifications on Android?

Navigate to Settings > Mobile Apps. Click the mobile app for which you'd like to send a push notification. For Device Token, enter the token you located above. For Message, enter a message to display in the push notification.


2 Answers

Google's official answer is the Android Cloud to Device Messaging Framework (deprecated) Google Cloud Messaging(deprecated) Firebase Cloud Messaging

It will work on Android >= 2.2 (on phones that have the Play Store).

like image 90
BoD Avatar answered Sep 21 '22 16:09

BoD


(cross-posting from an answer I gave to a similar question - Does Android support near real time push notification? )

I recently started playing with MQTT http://mqtt.org for Android as a way of doing this sort of thing (i.e. push notification that is not SMS but data driven, almost immediate message delivery, not polling, etc.)

I have a blog post with background information on this in case it's helpful

http://dalelane.co.uk/blog/?p=938

(Note: MQTT is an IBM technology, and I should point out that I work for IBM.)

like image 45
dalelane Avatar answered Sep 21 '22 16:09

dalelane