Samsung's TWLauncher allows apps to create badge counts on app icons.
This is completely undocumented! There is no mention of it anywhere, and only a handful of apps are using it (e.g. Facebook, eBay).
How do you use this functionality to add a count to your app icon?
This is very specific to Samsung devices. I am not asking about Android in general. I'm only asking about badging Samsung's Touchwhiz interface which currently allows badging. Android does not.
For Android 8.0 Oreo Users-
For those who are getting trouble in showing badge count for Samsung S8, S9 or Pixel devices having Oreo in them note that ShortcutBadger Library does not supports
API>26
forSamsung
Reported here in issues. Here you have to check it first ifisBadgeCounterSupported
like that -The only way is to apply Badges from Notification. As for applying badges from your notifications, see the Android documentation, and note the section "Set custom notification count".
For more on Notifications in Android 8.0 refer to this answer .
I use this class for Samsung and Sony devices (also available https://gist.github.com/Tadas44/cdae2f5995f21bf1c27f). Don't forget to add
<uses-permission android:name="com.sonyericsson.home.permission.BROADCAST_BADGE" />
to AndroidManifest.xmlThere is another tool that you can use for Xperia devices
More details as below
http://www.marcusforsberg.net/blog/android-notification-badge-app-icon-sony/
In android, we don't have badge style approach as iOS but some manufactures are supporting to display badge on app icons.
Support for sony and HTC.
Example for badge style icon on app in android
Sony and HTC supports adding badge to the app icon.
For Sony
for HTC:
There is another cool open source library that support different devices: https://github.com/leolin310148/ShortcutBadger/
First you'll need to add the following permissions to your AndroidManifest.xml file.
The column structure is as follows:
In order to query ALL results from the BadgeProvider do the following:
In order to add a badge count to your application icon
If you want to clear the badge count on your icon
NEW
I have created an open source project that you can import as a library to assist with this. It's licensed as Apache so feel free to use it as you please.
You can get it from here: https://github.com/shafty023/SamsungBadger