Smart Phone Ad hoc Network (SPAN) for Rescue Applications
Loading...
Date
Journal Title
Journal ISSN
Volume Title
Publisher
University of M'sila
Abstract
Natural disasters, large-scale emergency operations, and remote rescue missions share a
common challenge: the collapse or unavailability of conventional communication
infrastructure. Cellular networks, internet access points, and centralized servers become
unreliable precisely when they are needed most. In such contexts, rescue teams require a
lightweight, self-organizing, and infrastructure-independent communication system that can
be deployed instantly using nothing more than the smartphones already in their hands.
This thesis presents the complete design, architectural conception, and full Flutter/Dart
implementation of SPAN RESCUE — a decentralized, peer-to-peer (P2P) mesh network
application for Android. The system enables a group of smartphones to discover each other,
form a local ad hoc network, and exchange structured messages in real time, without any
reliance on the internet, external servers, or pre-configured infrastructure. Device discovery is
accomplished through a hybrid mechanism combining Wi-Fi Direct P2P group formation with
UDP broadcast beacons sent every 15 seconds on port 44444. Reliable data transport is
achieved through persistent TCP socket connections on port 8888 managed by a dedicated
group owner (GO), with UDP serving as an energy-efficient fallback mechanism. A
store-and-forward queue preserves critical messages when connectivity is temporarily
unavailable, and a bridge manager extends the mesh across multiple Wi-Fi Direct groups.
The application architecture is organized into five distinct layers: the Flutter UI layer, the
business logic layer (MeshService), the transport layer (WifiDirectService), a platform bridge
layer connecting Dart to native Android Wi-Fi P2P APIs via MethodChannel, and the
hardware layer. Four specialized helper modules — StoreForwardQueue, BridgeManager,
MeshRouter, and P2pHelper — complete the system. The application provides four primary
screens: a Mesh Map screen with a tactical radar overlay and OpenStreetMap integration; a
Global Squad chat screen supporting text messages, voice messages, and SOS emergency
alert cards; a Tactical AODV Topology screen for live mesh visualization; and a System Logs
screen displaying real-time network events with ISO 8601 timestamps.
Implementation in Flutter 3.x and Dart 3.x with a Kotlin native bridge required solving
four categories of platform-specific challenges: null-pointer exceptions in the
flutter_p2p_connection plugin when processing empty peer maps, non-deterministic group
owner election across device manufacturers, delayed availability of P2P IP addresses after
group formation, and battery optimization constraints affecting background UDP scan
continuity. Validation across five Android devices from four different manufacturers
confirmed correct operation of all core networking functions, SOS message propagation, and
topology visualization.