Small red dot badge practice code on Android Application Icon

Now there are many apps in Android that mimic Apple's and display small red dots on the app icon. Of course, there are some mobile phone ROM support for small red dots, such as Xiaomi, Samsung, etc. Google's API does not provide this function. This function is generally customized by the manufacturer, so it really gives developers a headache. I also made it for two days. Not all models can be improved in the future. I hope it will be helpful to people who read articles or are confused!

Rendering: (Dodo is my application, Xiaomi miui8 test)

Go directly to the code. There are comments in the code:

Go directly to the code. There are comments in the code:

Badgeutil class:

Summary:

Xiaomi, Samsung, Sony, HTC, Duowei. The basic red dot function of some mobile phones in their hands is no problem

Oppo: the manufacturer does not provide this function, but only for the top 5 Commercial chat in the market. It also said that this function will be provided for the im within the enterprise, but the oppo certificate must be integrated

Huawei: the same as oppo, but according to the above code test, some Huawei models can be realized. Glory 6 and 6p have no effect

Vivo: some mobile phones work, but vivo xplay5 X7 doesn't

As for hammer, Meizu, Jinli, etc., it is said on the Internet that this function is not supported, because there is no testing machine and no verification

LETV: it has its own effect (if you don't ask customer service, you won't make trouble!)

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>