Aquila.Network
1.0.0
dotnet add package Aquila.Network --version 1.0.0
NuGet\Install-Package Aquila.Network -Version 1.0.0
<PackageReference Include="Aquila.Network" Version="1.0.0" />
<PackageVersion Include="Aquila.Network" Version="1.0.0" />
<PackageReference Include="Aquila.Network" />
paket add Aquila.Network --version 1.0.0
#r "nuget: Aquila.Network, 1.0.0"
#:package Aquila.Network@1.0.0
#addin nuget:?package=Aquila.Network&version=1.0.0
#tool nuget:?package=Aquila.Network&version=1.0.0
Aquila.Network
Cross-platform network utilities for .NET MAUI applications.
Author: Aswin Sadhasivam Company: Aquila Innovations Website: https://aquilainnovations.in License: MIT License
1. Overview
Aquila.Network is a lightweight library designed to simplify network-related operations in .NET MAUI applications.
It provides:
- Network availability checking (online/offline)
- Network change event notifications
- Ping / API endpoint testing
- Cross-platform support for Android and Windows
- Static API for easy usage without DependencyService
This library is ideal for apps that need to react to connectivity changes or ensure that network operations only occur when the device is online.
2. Benefits
- Easy to Use: Call
NetworkManagermethods directly from shared MAUI code. - Cross-Platform: Supports Android and Windows with platform-specific implementations.
- Lightweight: No external dependencies or complex setup.
- Reusable: Can be distributed as a NuGet package for multiple projects.
- Event-driven: Subscribe to connectivity changes using a simple event.
- Extensible: Ready for future support on iOS, MacCatalyst, and other platforms.
3. Installation
NuGet
dotnet add package Aquila.Network
Or via Visual Studio:
- Right-click your project → Manage NuGet Packages
- Search for Aquila.Network
- Install the latest version
4. Usage
4.1 Check Online Status
using Aquila.Network;
if (NetworkManager.IsOnline())
{
Console.WriteLine("Device is online");
}
else
{
Console.WriteLine("Device is offline");
}
4.2 Subscribe to Network Changes
NetworkManager.NetworkStatusChanged += (sender, e) =>
{
if (e.IsOnline)
MsgBits.Show("You are back online!");
else
MsgBits.Show("You are offline!");
};
// Start monitoring (optional for Windows, automatic on Android)
#if ANDROID
Aquila.Network.Platforms.Android.NetworkService.StartMonitoring();
#elif WINDOWS
Aquila.Network.Platforms.Windows.NetworkService.StartMonitoring();
#endif
4.3 Ping a Server or API Endpoint
bool serverAlive = await NetworkManager.PingAsync("https://aquilainnovations.in");
MsgBits.Show(serverAlive ? "Server reachable" : "Server unreachable");
5. Architecture
- NetworkManager.cs → Shared static API for all MAUI projects
- Platforms/Android/NetworkService.cs → Android implementation using
ConnectivityManager - Platforms/Windows/NetworkService.cs → Windows implementation using
NetworkInformation - Events:
NetworkStatusChangedallows apps to react to connectivity changes
Platform-specific code is completely isolated. The shared API never references platform-specific classes directly.
6. Best Practices
- Use NetworkManager in shared code to keep your app platform-agnostic.
- Subscribe to NetworkStatusChanged events to handle offline/online scenarios dynamically.
- Avoid direct references to platform APIs in your app code.
- Use
PingAsyncto check server availability before executing network requests. - For long-running network checks, run
PingAsyncinside aTask.RunorDispatcherto avoid UI blocking.
7. FAQ
Q: Does this work on iOS or MacCatalyst? A: Currently, the library supports Android and Windows. iOS/MacCatalyst support can be added later.
Q: Do I need to register anything in MauiProgram.cs?
A: No, NetworkManager is static; no DependencyService registration is required.
Q: Can I customize how often network changes are checked?
A: On Android, the library uses ConnectivityManager callbacks for real-time detection. On Windows, the library uses NetworkInformation.NetworkStatusChanged events.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-android34.0 is compatible. net8.0-windows10.0.19041 is compatible. net9.0-android was computed. net9.0-windows was computed. net10.0-android was computed. net10.0-windows was computed. |
-
net8.0-android34.0
- Microsoft.Maui.Controls (>= 8.0.100)
- Microsoft.Maui.Controls.Compatibility (>= 8.0.100)
-
net8.0-windows10.0.19041
- Microsoft.Maui.Controls (>= 8.0.100)
- Microsoft.Maui.Controls.Compatibility (>= 8.0.100)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 182 | 2/2/2026 |