Skip to content

slydeveloper/android-internet-stats-example

Repository files navigation

Android internet stats - example

Here is a very simple example how to prepare a mechanism for checking internet connection. It allows to detect if device has internet connection and of connection as well (Mobile or Wifi).

Goals

The example application has the following goals:

  • Check if device has internet connection
  • Detect connection type (Mobile or Wifi)
  • Handle system event when internet connection has changed

Solution

  • Example mostly based on the ConnectivityManager which allows get state of network connectivity
  • Register the BroadcastReceiver on action: <action android:name="android.net.conn.CONNECTIVITY_CHANGE"/> for handle any change of connectivity

Screen

Screen

Releases

No releases published

Packages

No packages published

Languages