Summary
Implement Android support for connection_status().
The types, command, permissions, and JS/TS bindings have already been merged in #2.
Android exposes everything needed through ConnectivityManager and NetworkCapabilities (available since API 23, with registerDefaultNetworkCallback since API 24): reachability via the active Network and NET_CAPABILITY_INTERNET / NET_CAPABILITY_VALIDATED, metered state via the absence of NET_CAPABILITY_NOT_METERED, the constrained flag via Data Saver (getRestrictBackgroundStatus) and NET_CAPABILITY_TEMPORARILY_NOT_METERED, and the active transport via TRANSPORT_WIFI, TRANSPORT_ETHERNET, and TRANSPORT_CELLULAR. Implementation will follow Tauri's mobile plugin pattern with a Kotlin bridge under android/src/main/ invoked from Rust via the plugin's mobile entry point.
The existing ConnectionStatus field mappings in src/types.rs already document the Android counterparts (NET_CAPABILITY_NOT_METERED, RESTRICT_BACKGROUND_STATUS). The plugin manifest will need to declare android.permission.ACCESS_NETWORK_STATE.
Out of Scope
- Windows, Linux, macOS, and iOS backends — separate follow-ups.
- Change-notification / observer APIs for status transitions (
NetworkCallback).
- Data-limit fields (
approaching_data_limit, over_data_limit) — not distinctly exposed by NetworkCapabilities (only the rolled-up metered / Data Saver signals).
- Roaming flag —
NET_CAPABILITY_NOT_ROAMING is available but folded into constrained rather than surfaced as a separate field.
- Legacy
NetworkInfo fallback for pre-API 23 systems — minimum target is API 23+.
Summary
Implement Android support for
connection_status().The types, command, permissions, and JS/TS bindings have already been merged in #2.
Android exposes everything needed through
ConnectivityManagerandNetworkCapabilities(available since API 23, withregisterDefaultNetworkCallbacksince API 24): reachability via the activeNetworkandNET_CAPABILITY_INTERNET/NET_CAPABILITY_VALIDATED, metered state via the absence ofNET_CAPABILITY_NOT_METERED, the constrained flag via Data Saver (getRestrictBackgroundStatus) andNET_CAPABILITY_TEMPORARILY_NOT_METERED, and the active transport viaTRANSPORT_WIFI,TRANSPORT_ETHERNET, andTRANSPORT_CELLULAR. Implementation will follow Tauri's mobile plugin pattern with a Kotlin bridge underandroid/src/main/invoked from Rust via the plugin's mobile entry point.The existing
ConnectionStatusfield mappings insrc/types.rsalready document the Android counterparts (NET_CAPABILITY_NOT_METERED,RESTRICT_BACKGROUND_STATUS). The plugin manifest will need to declareandroid.permission.ACCESS_NETWORK_STATE.Out of Scope
NetworkCallback).approaching_data_limit,over_data_limit) — not distinctly exposed byNetworkCapabilities(only the rolled-up metered / Data Saver signals).NET_CAPABILITY_NOT_ROAMINGis available but folded intoconstrainedrather than surfaced as a separate field.NetworkInfofallback for pre-API 23 systems — minimum target is API 23+.