Skip to content

Latest commit

 

History

History
executable file
·
20 lines (16 loc) · 957 Bytes

README.md

File metadata and controls

executable file
·
20 lines (16 loc) · 957 Bytes

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