Push Notification in Android Using Urban Air Ship

  Hi All,   I had implemented Push  Notification [ Using Urban Air Ship]  application in Android, 
 with the help  of the steps shown in the Urbran  Air Ship documentation  

 It works in a nice and fine manner,and also i got notifcation, when my feed is updated. Here's the step what had  done.

Step1: Create a Account in Urban Air Ship,  https://go.urbanairship.com/

Step2: Download android_push.jar from here https://github.com/urbanairship/android-push-library/downloads

Step3: register the receiver in AndroidManifest.xml before closing your closing your application tag file as shown below


<receiver android:name="com.urbanairship.push.IntentReceiver">
<action android:name="com.urbanairship.airmail.END_REGISTER"></action>
<action android:name="com.urbanairship.airmail.ACCEPT_PUSH"></action>
<action android:name="com.urbanairship.airmail.NOTIFY"></action>

Step 4: Login in your Account, Register Your Application in their site. For that Click Apps option in your account.

Step5: After Clicking the Apps the icon, you are able to see Add your Application Option as shown in the following diagram
Step6: Enter your App Name and Click Push Notification Support, then fed your package name. and Click create your App Button, A new Window will give you,Application Key.   
See this image. 


Step 7: Create a file called ua.properties under raw folder which is under in res folder, i.e., res/raw/ua.properties file

Step8: Fed the Application Key which you got after App registartion in Urban AirShip and also finger print of your App in ua.properties file as shown below.


Step 9: Create a Application Class as shown Below

import com.urbanairship.push.APIDReceiver;
import com.urbanairship.push.AirMail;
import com.urbanairship.push.PushReceiver;

import android.app.Application;
import android.content.Intent;
import android.util.Log;

public class PushNotification extends Application {
public void onCreate(){
AirMail am = AirMail.getInstance();
am.acceptPush(this, new PushReceiver() {
public void onReceive(String message, String payload){
Log.d("push", "Got message '" + message +"' and payload '" + payload + "'");

public void onClick(String message, String payload){
Log.d("push", "User clicked the notification, got message and payload: "
+ message + ", " + payload);
/* In this example, we fire up our MainActivity class when the
* user clicks the Status Bar Notification. Note that we *must*
* use the flag Intent.FLAG_ACTIVITY_NEW_TASK to start a new
* activity because this callback is fired from within a
* BroadcastReceiver.
Intent intent = new Intent("android.intent.action.MAIN");

am.setAPIDReceiver(this, new APIDReceiver() {
public void onReceive(String apid, boolean valid){
Log.d("push", "Got apid: " + apid);
} else {
Log.d("push", "Application registration invalid!");

public void onAirMailInstallRefusal() {
Rss_Feed_Grid.register = false;
Log.d("push", "AirMail Install Refused!");

Step 10: Check the following registration code in your Activity

protected static boolean register = true;

AirMail am = AirMail.getInstance();
Step 11:
Update Your Manifest in order to register your application

<application android:icon="@drawable/icon" android:label="@string/app_name" android:name=".PushNotification">

Step12: Now Click Push Notification and then click feed Button in Urbran Air Ship, then fed url which is to be monitored

That's it..


[1]: http://i.imgur.com/NFIa4.jpg
[2]: http://i.imgur.com/DJkH1.jpg
[3]: http://i.imgur.com/BOCxk.png

Notification in Android Using AlarmManager, BoradCastReceiver & Services

    Our aim is to show notification message to user in a specific time.     Say For example , I have planned to show Notification ...