Augmented Reality (AR) View
Relevant source files
The following files were used as context for generating this wiki page:
The Augmented Reality (AR) View is a specialized visualization component within the ShadowCheck Mobile application designed to provide real-time, spatial orientation of detected wireless networks. By overlaying network data onto a live camera feed, the module allows users to physically locate signal sources such as WiFi access points based on their geographic coordinates and signal strength.
Sources: README.md:14, app/src/main/kotlin/com/shadowcheck/mobile/ARNetworkView.kt:33-40
Architecture and Components
The AR system is built using Jetpack Compose and integrates Android's CameraX API for the background video stream. It consists of three primary layers: the Camera Preview, the AR Overlay (Canvas), and the User Interface (UI) controls.
Component Hierarchy
The following diagram illustrates the structural relationship between the AR View components:
The system uses a Box layout to stack the live camera feed behind a custom drawing Canvas that renders the network markers.
Sources: app/src/main/kotlin/com/shadowcheck/mobile/ARNetworkView.kt:40-66
Key Classes and Functions
| Component | Description |
|---|---|
ARNetworkView | The entry-point Composable that manages state for azimuth and pitch. |
CameraPreview | Handles the ProcessCameraProvider and PreviewView to display the rear camera feed. |
AROverlay | A Canvas component that calculates spatial positioning and draws markers for each network. |
WifiNetwork | Data model containing SSID, BSSID, signal level, and GPS coordinates. |
Sources: app/src/main/kotlin/com/shadowcheck/mobile/ARNetworkView.kt:33-38, app/src/main/kotlin/com/shadowcheck/mobile/ARNetworkView.kt:73-85, app/src/main/kotlin/com/shadowcheck/mobile/ARNetworkView.kt:105-110
Spatial Calculation Logic
The AROverlay determines where to place network markers on the screen by comparing the user's current GPS location with the recorded location of the WifiNetwork.
- Distance and Bearing: The system uses
Location.distanceBetweento calculate the relative distance and bearing from the user to the target network. - Azimuth Normalization: The bearing is adjusted against the device's current azimuth (heading). The resulting value is normalized to a range of -180 to 180 degrees.
- Field of View (FOV) Filtering: Only networks within a 60-degree arc in front of the camera and within a 500-meter range are rendered.
Visual Indicators
Network signal strength is represented through color-coded markers drawn on the AR overlay.
| Signal Level (dBm) | Marker Color | Visual Description |
|---|---|---|
| >= -60 dBm | Color.Green | Strong signal |
| >= -75 dBm | Color.Yellow | Moderate signal |
| < -75 dBm | Color.Red | Weak signal |
Each marker consists of a signal-colored outer circle (80% alpha) and a solid white inner dot for precise targeting.
Sources: app/src/main/kotlin/com/shadowcheck/mobile/ARNetworkView.kt:140-159
System Requirements and Permissions
The AR View depends on hardware features and software services to function correctly.
- Permissions: Requires
CAMERAfor the live feed andACCESS_FINE_LOCATIONfor distance calculations. - Hardware Features: Utilizes
android.hardware.camera.arand requires GLES 3.0. - Software: Dependent on "Google Play Services for AR" (ARCore). The application includes logic to prompt for installation if these services are missing.
Sources: app/src/main/AndroidManifest.xml:21-25, app/src/main/AndroidManifest.xml:34, app/src/main/res/values-en-rCA/strings.xml:4-8, app/src/main/res/raw/keep_arcore.xml:10-14
The AR Network View serves as a critical utility for physically locating signal interference or unauthorized access points by bridging the gap between digital signal data and the physical environment.