An Android library supports badge notification like iOS in Samsung, LG, Sony and HTC launchers.
From StackOverflow a android user WeWe asked a question :
Q. How to display balloon counter over application launcher icon on android

Then i search and find a helpful android library named ShortcutBadger. The ShortcutBadger makes your Android App show the count of unread messages as a badge on your App shortcut!
Support launchers:

Download Library

USAGE


1. Add mavenCentral to your build script.
    repositories {
        mavenCentral()
    }
2. Add dependencies for ShortcutBadger, it's available from maven now.
    dependencies {
        compile 'me.leolin:ShortcutBadger:1.1.4@aar'
    }

3. Add the codes below:
int badgeCount = 1;
    ShortcutBadger.applyCount(context, badgeCount); //for 1.1.4
    ShortcutBadger.with(getApplicationContext()).count(badgeCount); //for 1.1.3

4. If you want to remove the badge
    ShortcutBadger.removeCount(context); //for 1.1.4
    ShortcutBadger.with(getApplicationContext()).remove();  //for 1.1.3
or

    ShortcutBadger.applyCount(context, 0); //for 1.1.4
    ShortcutBadger.with(getApplicationContext()).count(0); //for 1.1.3

Note :

If you receive mail from Google contains message like :
    REASON FOR WARNING: Violation of section 4.4 of the Developer Distribution Agreement.
Please use version 1.1.0+
4

View comments

  1. Hello ,
    Great lib, but one thing : your library does not support for pure android. for that what i do ?

    ReplyDelete
  2. You have only copy pasted the library, why don't you elaborate the things related to library.
    Where to put the library in cordova app if i'm using the eclipse.
    Where to write the code :
    int badgeCount = 1;
    ShortcutBadger.applyCount(context, badgeCount); //for 1.1.4
    ShortcutBadger.with(getApplicationContext()).count(badgeCount); //for 1.1.3

    ReplyDelete
    Replies
    1. I got your problem and my next post you can get your solution but yet you can make badge in android manually.
      Just check this post :Make Badge(Item count) in Android [Tutorial]

      Delete
  3. I got your problem and my next post you can get your solution but yet you can make badge in android manually.
    Just check this post :Make Badge(Item count) in Android [Tutorial]

    ReplyDelete
Contributors
Contributors
Popular Posts
Popular Posts
Archive
Labels
Labels
Loading
Dynamic Views theme. Powered by Blogger. Report Abuse.