11

--Edit on 23 Apr 2016--

I finally used ShortcutBadger in most areas of my Device, I think that should be enough for me.

ShortcutBadger

Basically, Shortcut Badger will send broadcast, intent, etc to specific launcher, such as LG Launcher, to make a badge. It may not cover all the launchers but at least it works for the most recent smart phones.

--Edit--

What I am seeing on LG G2 (4.4), there is a number of some of the Apps, e.g. Line, which showing unread count.

This is the application badge I mean and I want to find a way to work that out.

This number will also be notified by the launcher itself, when the app in put inside a folder, the folder will also show the badge.

I think there should have ways to make it work, as I found several apps having badges.

--Original--

I did a search before and I found that there is a way to make application badge on Samsung and Sony, but what I want is to support other vendor, such as LG and HTC.

Is there an universal way to make an application badge?

Thanks for your help!

Michele La Ferla
  • 6,265
  • 11
  • 44
  • 75
JTam
  • 111
  • 2
  • 5
  • 3
    What, exactly, is an "application badge"? – CommonsWare May 17 '14 at 15:44
  • @CommonsWare you know how on an iPad or iPhone it will display a red icon above the AppStore icon (updates) – mrres1 May 17 '14 at 15:50
  • An overlay on top of your app's icon? Maybe what you want is a [widget](https://developer.android.com/guide/topics/appwidgets/index.html). You can make it 1x1 and show any dynamic images you like. – indivisible May 17 '14 at 16:02
  • 2
    There is no universal reliable means of doing this. The technique outlined in k0sh's answer comes closest, but not all home screen implementations will handle it properly. An app widget, as indivisible suggests, is a better solution. – CommonsWare May 17 '14 at 16:07
  • Is this solved in current Android? It's 2016 now. – Romulus Urakagi Ts'ai Apr 22 '16 at 03:14
  • 1
    Yes, I finally use ShortcutBadger for most of the Device, I think that should be enough for me. – JTam Apr 23 '16 at 11:17
  • you can have a look at this project, which is has what you looking for [Stock Android Launcher Badges (without TouchWiz)](https://github.com/slightfoot/android-launcher-badges) – Kosh May 17 '14 at 15:46
  • I also use ShortcutBadger in some apps – jaumebd Apr 25 '16 at 14:45
  • I have code for Action Item badge,If I post the code will it be good for you@JTam. – Lampard Apr 28 '16 at 06:31
  • Possible duplicate of [Is there a way to add a badge to an application icon in Android?](https://stackoverflow.com/questions/2905542/is-there-a-way-to-add-a-badge-to-an-application-icon-in-android) – Shirish Herwade Nov 14 '17 at 11:10

2 Answers2

0

Unfortunately, Android does not allow changing of the application icon because it's sealed in the APK once the program is compiled. There is no way to programmatically change it to a 'drawable'.

You may achieve your goal by using a widget instead of an icon. Widgets are highly customisable and can do what you want.

Original reference is here

You can also go with Badges library

Community
  • 1
  • 1
Harsh Patel
  • 579
  • 10
  • 23
0

Stock Android does not offer this functionality at the moment on the standard launcher.

Certain manufacturers (e.g. Samsung notably, HTC, LG, Mi) have included this functionality into their customized Android launchers. Also some 3rd-party launchers (e.g. Nova Launcher) have included an API to accomplish this.

You may want to check following links for further explanation:

  1. How does Facebook add badge numbers on app icon in Android?
  2. Does Samsung modifies it's Android ROMs to have badges on email and SMS icons?
  3. How to make application badge on android?

Regards

Community
  • 1
  • 1
Hardik Vaghani
  • 2,119
  • 21
  • 40