In my android app, I would like to test if a user can access the internet. I know I able to test if he is connected to wifi or 3G/4G, etc... but maybe the user is connected to a local network and doesn't have access to the internet.
Should I try a "ping" to google to be sure that he can download anything or does it exist a function which ensure the phone has internet ?
Thanks.