You can determine if there’s an active Internet connection without checking the wifi info.
Evening Newbs
- 0 Posts
- 2 Comments
Joined 2 years ago
Cake day: June 17th, 2023
You are not logged in. If you use a Fediverse account that is able to follow users, you can follow this user.
Incorrect. If you aren’t using
WifiManager
, you don’t needACCESS_WIFI_STATE
or location permissions. ConnectivityManager gives information to know the connection type with onlyACCESS_NETWORK_STATE
, which is granted automatically on install without prompting the user to allow.And besides that, you should really be checking
ConnectivityManager.isActiveNetworkMetered()
instead of the connection type anyway, since the user could be on tethered wifi, for instance.