Network Change Instrumentation
Generates: Events
Detects connectivity changes using ConnectivityManager.NetworkCallback. Only active when the app is in the foreground.
Configuration
Enabled by default via networkMonitoring { }:
PulseSDK.INSTANCE.initialize(
application = this,
apiKey = "your-api-key",
dataCollectionState = PulseDataCollectionConsent.ALLOWED,
) {
networkMonitoring { enabled(false) } // Disable if not needed
}
What Gets Tracked
- Network lost and available events
- Connection type (wifi, cellular, vpn, wired)
- Connection subtype and carrier info (requires permission — see below)
Permissions
No permission is required for basic connectivity tracking (connected/disconnected, WiFi vs cellular).
To also capture mobile network subtype (LTE, 5G) and carrier name, declare one of the following in AndroidManifest.xml and request it at runtime:
<!-- API 33+ — prefer this -->
<uses-permission android:name="android.permission.READ_BASIC_PHONE_STATE" />
<!-- Below API 33 -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
Without this permission, network.connection.subtype and network.carrier.* attributes are omitted.
Attributes
| Attribute | Description | Always Present |
|---|---|---|
pulse.type | "network.change" | ✅ |
network.status | "available" or "lost" | ✅ |
network.connection.type | wifi, cell, wired, vpn, unavailable | ✅ |
network.connection.subtype | LTE, 5G, etc. | ⚠️ Requires permission |
network.carrier.name | Carrier name | ⚠️ Requires permission |
network.carrier.mcc/mnc/icc | Carrier codes | ⚠️ Requires permission |
screen.name | Current screen | ⚠️ If available |