Search This Blog

Tuesday 3 July 2012

Android 4.1 Rich Notifications


New Notification APIs in Android 4.1


Android 4.1 (Jelly Bean) expanded the notification framework Now the apps can create big and rich notifications those can be expand or collapse with a pinch or swipe. The notifications added new content types including photos and have a configurable priority.


The user could have multiple response for a status notification. Now with enhanced notification framework the android app developers can build really good notifications for the user.
  • BigTextStyle — a notification that includes a multiline TextView object.
  • BigInboxStyle — a notification that shows any kind of list such as messages, headlines, and so on.
  • BigPictureStyle — a notification that showcases visual content such as a bitmap.
In addition to the templated styles, you can create you own notification styles using any remote View.
Apps can add up to three actions to a notification, which are displayed below the notification content. The actions let the users respond directly to the information in the notification in alternative ways. such as by email or by phone call, without visiting the app.


With expandable notifications, apps can give more information to the user, effortlessly and on demand. Users remain in control and can long-press any notification to get information about the sender and optionally disable further notifications from the app.


The setStyle() API allow you to set the new style for the notifications. The multiple actions to the notification can be add using addAction() API.


The setPriority() method could be use to define the priority of the notification for the system.

No comments:

Post a Comment