How do I notify my Android app about permissions granted by cyberoam if Wi-Fi is connected?

I created an Android application for detecting an Internet connection with the intent filter "android.net.conn.CONNECTIVITY_CHANGE" and I get a callback in myBroadcastReceiver when Wi-Fi is connected and disconnected, but I want to receive callbacks when wifi gets authorization a when not? Like we have cyberoam, which will restrict access to the Internet until we give us our authority, so how can I get a notification when I am authorized to access the Internet, and when not?

+4
source share
1 answer

There is no event for Android for this. As far as your phone knows that you are connected to the network. If the network does not give you access to the Internet, another thing. The best you can do is ping a known IP address and see if you get a response. But don't ping too often. Otherwise, you may be blocked.

+1
source

Source: https://habr.com/ru/post/1626345/


All Articles