Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Badge on App icon

I need to show badge on App icon in my application

what i have tried:

  1. This https://github.com/leolin310148/ShortcutBadger library do it on many devices.I have checked its manifest and saw that there exists a permission for each type of launcher

     <!--for Samsung-->
       <uses-permission      android:name="com.sec.android.provider.badge.permission.READ"/>
     <uses-permission android:name="com.sec.android.provider.badge.permission.WRITE"/>
    
     <!--for htc-->
    <uses-permission android:name="com.htc.launcher.permission.READ_SETTINGS"/>
     <uses-permission android:name="com.htc.launcher.permission.UPDATE_SHORTCUT"/>
    
      <!--for sony-->
     <uses-permission android:name="com.sonyericsson.home.permission.BROADCAST_BADGE"/>
     <uses-permission android:name="com.sonymobile.home.permission.PROVIDER_INSERT_BADGE"/>
    <!--for apex-->
    <uses-permission android:name="com.anddoes.launcher.permission.UPDATE_COUNT"/>
    
     <!--for solid-->
     <uses-permission android:name="com.majeur.launcher.permission.UPDATE_BADGE"/>
    
     <!--for huawei-->
     <uses-permission android:name="com.huawei.android.launcher.permission.CHANGE_BADGE" />
     <uses-permission android:name="com.huawei.android.launcher.permission.READ_SETTINGS" />
     <uses-permission android:name="com.huawei.android.launcher.permission.WRITE_SETTINGS" />
    
     <!--for ZUK-->
     <uses-permission android:name="android.permission.READ_APP_BADGE"/>
    

2.I have gone through many available answers that are already on stackoverflow like

How to display count of notifications in app launcher icon

can we show badge number on android app icon like iphone?

How to show badge count with app icon on Redmi?

Add unread notification badge on android app icon

Is there a way to add a badge to an application icon in Android?

All these resources helped me to attain the task on above mentioned devices but i can still see there are lot man devices like xiomi,micromax etc in which app like wtsapp,facebook etc are showing badges but i am unable to show badge on these devices.

Have anyone here has achieved it.Any help will be appreciated.

like image 531
Harry Sharma Avatar asked Oct 18 '22 23:10

Harry Sharma


2 Answers

This is not a feature the of Android system. Device manufacturers (like Xiaomi you mentioned) or launcher developers (like Nova Launcher) can implement it and expose an api for app developers, but there is no standard for that, nor is it expected by the users to be there.

In general, you should not try to do this on Android.

like image 169
Kelevandos Avatar answered Oct 21 '22 04:10

Kelevandos


For displaying badge, Google may have stopped showing numbers count on App Icon as a badge but I think it's still showing a dot to let the user know there is something new to that app.

For more information you can go through this official link from Google : https://developer.android.com/training/notify-user/badges

like image 44
OMI HARISHCHANDRA MEHTA Avatar answered Oct 21 '22 04:10

OMI HARISHCHANDRA MEHTA