I wanna use a library from GitHub named "Android Network Tools", but actually I have a complex issue when using that. I tested the ping of this library on different type of devices and Android versions, and it worked correctly and was perfect, but when I tested it on my Samsung Galaxy S8 with android 8 I saw pinging external IP(like google.com) didn't work! at the first, I thought it happens in Android 8 and tried to solve it, but I launched it in Android 8 with the emulator that was ok! after that, I decided to test it on my friend's Samsung J7, you can guess that what happened, it didn't work again! Right now, I'm really really confused because of I don't know why it happens just on Samsung devices, do you have any idea?
Finally, I found the problem, this was about control running apps in the background! when that feature be enabled some methods and ping doesn't work correctly in real-time.