In this android development tutorial we will deal with android push notification if you are new to this scenario please go through this tutorial completely.

Push Notification in android are used to pass a message when app is not in active state also.Generally push notification are used in chatting based apps to show a new message, and also it has usages in other different apps like news, eCommerce, shopping apps, games and many more … lets start android push notification tutorial

 

In this push notification tutorial i will show you a how a push notification works in a local style i.e., data will be created and passed within same activity itself.

 

pushnotification1

 

The push notification contains

 

Creating Project in Android Studio

creating proj

 

Select

File -> New..->New Project

you will see the above screen

 

Fill in the project details, and choose the layout depending upon your requirement if you are beginners and don’t know what to choose choose blank activity.

 

In layout file i have added the required number of  edittext, and buttons to create push notifications, you may change your design accordingly.

activity_main.xml

 

 

In this MainActivity.java we have Declared our Push Notification

 

And made a notification screen such that user entered text will get displayed as a Push Notification.

 

MainActivity.java File

 

No Additional Permissions required as this is local data based Push Notification but when you are doing with server based push notifications you will require Internet Permission.

AndroidManifest .xml

 

Output :

pushnotification5   pushnotification4    pushnotification3

 

 

 

 

 

 

 

If you have any query add comment below.

Like and share this tutorial if you like it.

Show Buttons
Hide Buttons
Read previous post:
Android SQLite Tutorial On Inserting, Deleting Values into Database

Close