0

As the title describes, I am developing android application, and I want to know whether the current WIFI connection is a hotspot connection. If so, I will pause the download process so that the cellular data will not be wasted. I did not find any official APIs that can do this functionality. So I wonder if anyone has done something about it?

Mike
  • 1

1 Answers1

0

The ConnectivityManager method isActiveNetworkMetered() (or the equivalent ConnectivityManagerCompat.isActiveNetworkMetered() if you need to support devices less than API 16) tells you exactly when a network is metered. A WiFi hotspot will be a metered connection.

ianhanniballake
  • 191,609
  • 30
  • 470
  • 443