How To Add Notification On Your Android App Tutorial
Today we all know how much far has android gone and it is the future of tomorrow.In today's world android app market is becoming big and more big day to day and that's the reason most of the young techies and programmer want's to build apps on android platform .And some of us face problem in How to add the notification part in your android app so don't worry friends that's the reason you are here so here is the the tutorial and code which will help you to add notification feature in your dream android app.So let's get started..........
What is Android Notification?
A notification is a message you can display to the user outside of your application's normal UI. When you tell the system to issue a notification, it first appears as an icon in the notification area. To see the details of the notification, the user opens the notification drawer. Both the notification area and the notification drawer are system-controlled areas that the user can view at any time.
What are we going to do?
Today, we will make an android notification and we will use an intent to respond to the user if the notification clicked.
1.
Notice the Notification (yeah bro) |
3.
responds when the notification clicked |
1
2
3
4
5
| <linearlayout android:layout_height= "match_parent" android:layout_width= "match_parent" android:orientation= "vertical" xmlns:android= "http://schemas.android.com/apk/res/android" > <textview android:layout_height= "wrap_content" android:layout_width= "wrap_content" android:text= "Look at the notification Window!" android:textsize= "30sp" > </textview></linearlayout> |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class NotifyActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView txtdisplay= new TextView( this ); txtdisplay.setText( "Yeah you did it!" ); setContentView(txtdisplay); } } |
1
2
3
4
| < string name= "message" >hey you really great</ string > < string name= "noticeMe" >Yeah bro!</ string > < string name= "title" >you are excited, Yeah!</ string > |
1
| <activity android:label= "@string/app_name" android:name= ".NotifyActivity" ></activity> |
Spark It Up
How To Add Notification On Your Android App Tutorial
4/
5
Oleh
Unknown
thanks for commenting !!!