Android – how often do you send an action in an actual device_ BATTERY_ CHANGED?

In the emulator, if the power capacity is set to a value different from the current value, the onReceive of my broadcastreceiver will be called with the new value

In a real device, its battery will discharge from 100% to 20% in a few days, so my onReceive method will be called:

>Exactly 80 times > more than 80 times or > less than 80 times?

Re: possible duplication - I'm also worried that the calling frequency of the handler is not high enough. I didn't make a mistake to register a broadcast receiver from another broadcast receiver

resolvent:

It seems that the most common behavior is to send 80 messages accurately, but some devices will send more or less messages. There are great differences between actual devices, so it is necessary to benchmark the specific devices to be used or processed in general

For most of the devices I have used, in this case, action_ BATTERY_ Changed will be sent exactly 80 times. (intention will also be sent when inserting and unplugging the device.)

However, for a few models, this message is sent every time the battery temperature changes. This may happen very frequently, depending on the amount of processing being performed by the tablet. I am working from memory, but I believe that the Verizon ellisis 7 tablet behaves like this

Similarly, some devices obviously send messages less than once for every 1% battery change. Here is an example of more frequent messages and here is an example of fewer messages

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
分享
二维码
< <上一篇
下一篇>>