sergeykomlach/AdvancedBiometricPromptCompat

Ping downloads contents (and uses lots of data)

Closed this issue · 2 comments

I have set up the my host to ping using PingConfig.setHostsList("myUrl") at this url is my web pages home page which is around 500KB.

After getting a complaint from a user that my app was using lots of data in the background, I have tracked down the issue to this library. Instead of a real ping to check for connectivity it's downloading the entire HTML page and validating it. Before looking at the detail I assumed a ping would use a tiny amount of data and the data usage would not vary based on what I was pinging.

As an experiment I set the host list to empty using the following code:

PingConfig.setHostsList(arraySetOf())

After a little testing the library seems to be still working ok and doing what I need (without any extra data usage). This leads me to two questions.

  1. Is this going to cause problems as presumably the whole connectivity monitoring will no longer work.
  2. What exactly is the point of this connectivity monitoring? Why does this library even care if I'm online or not?

Thanks again for this great library and thanks in advance for your response!

With recent changes - Ping/Connection - related code is not used anymore and will be removed soon.
Thank you for bringing the problem to attention.

Published version 2.1.84
Ping/Connection classes now deprecated and not used anymore, I'll remove it in next releases.